Interface ArbiterStatic

Index

Properties

Methods

Properties

public updated_on: string

public version: string

Methods

public create(): ArbiterStatic

Creates a separate Arbiter instance.

Returns

ArbiterStatic

public publish(msg: string, data?: any, options?: PublishOptions): boolean

Publishes a message to all subscribers. Returns: true on success, false if any subscriber has thrown a js exception.

Parameters

  • msg: string

    Message may be in any format, but may not contain [ ,*]. A structure like a/b/c is recommended by convention, to allow messages to be categorized.

  • data?: any optional

    Pass data to subscribers that contains details about the message.

  • options?: PublishOptions optional

Returns

boolean

public resubscribe(subscription_id: number): boolean

After unsubscribing, you can later re-subscribe to begin receiving messages again.

Parameters

  • subscription_id: number

Returns

boolean

public subscribe(msg: string, func: SubscribeHandler): any

Subscribes to messages. Returns: subscription id or [id1,id2] if subscribing to multiple messages

Parameters

  • msg: string

    comma separated messages or use wildcard like a/b/*

  • func: SubscribeHandler

Returns

any

public subscribe(msg: string, options: SubscribeOptions, func: SubscribeHandler): any

Subscribes to messages. Returns: subscription id or [id1,id2] if subscribing to multiple messages

Parameters

Returns

any

public subscribe(msg: string, options: SubscribeOptions, context: any, func: SubscribeHandler): any

Subscribes to messages. Can use comma separated or wildcards in message. Returns: subscription id or [id1,id2] if subscribing to multiple messages

Parameters

Returns

any

public subscribe(msg: Array<string>, func: SubscribeHandler): any

Subscribes to messages. Returns: subscription id or [id1,id2] if subscribing to multiple messages

Parameters

  • msg: Array<string>

    comma separated messages or use wildcard like a/b/*

  • func: SubscribeHandler

Returns

any

public subscribe(msg: Array<string>, options: SubscribeOptions, func: SubscribeHandler): any

Subscribes to messages. Returns: subscription id or [id1,id2] if subscribing to multiple messages

Parameters

Returns

any

public subscribe(msg: Array<string>, options: SubscribeOptions, context: any, func: SubscribeHandler): any

Subscribes to messages. Returns: subscription id or [id1,id2] if subscribing to multiple messages

Parameters

Returns

any

public unsubscribe(subscription_id: number): boolean

Unsubscribing simply sets a flag which prevents the subscriber from executing, in case you want to re-subscribe later.

Parameters

  • subscription_id: number

Returns

boolean