Class idx.bus.Subscriber
EXPERIMENTAL API: Message Bus Subscriber for use with idx.bus
Defined in: <idx\bus\Subscriber.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
Field Summary
Field Attributes | Field Name and Description |
---|---|
The optional scope for filtering the messages that are seen by the
Subscriber's "handleAction" method.
|
|
Set this to true to interpret the 'subscriberScopeFilter' as a regular
expression.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
Constructor
Initializes the subscription bus topic and handle
|
|
handleBusMessage(msg)
This method is called with whatever messages are received on the bus after
having filtered them according to the scope filter.
|
|
setSubscriberScopeFilter(filter, isRegexp)
Convenience method for resetting the subscriber scope filter and its
intepretation in one call.
|
|
startup()
During startup, subscribes this instance to the bus.
|
|
Actually ends subscribing to to the bus as the implementing widget may
have its own startup() function.
|
|
Subscribes this instance to the bus if not already subscribed.
|
|
Unsubscribes this instance from the bus if subscribed.
|
Field Detail
{String} subscriberScopeFilter
The optional scope for filtering the messages that are seen by the
Subscriber's "handleAction" method. By default this is interpretted
as an exact string match on the message's scope (i.e.: only messages
with this exact scope are passed on). However, the filter can be
interpretted as a regular expression if subscriberScopeRegexp field
is set to true.
- Default Value:
- ""
{Boolean} subscriberScopeRegexp
Set this to true to interpret the 'subscriberScopeFilter' as a regular
expression. By default it is set to false to indicate that an exact
string match is required by subscribers.
- Default Value:
- false
Method Detail
constructor()
Constructor
Initializes the subscription bus topic and handle
handleBusMessage(msg)
This method is called with whatever messages are received on the bus after
having filtered them according to the scope filter.
- Parameters:
- {Object} msg
setSubscriberScopeFilter(filter, isRegexp)
Convenience method for resetting the subscriber scope filter and its
intepretation in one call.
- Parameters:
- {String} filter
- {Boolean} isRegexp
startup()
During startup, subscribes this instance to the bus.
subscriberStartup()
Actually ends subscribing to to the bus as the implementing widget may
have its own startup() function. This should be called during startup.
subscribeToBus()
Subscribes this instance to the bus if not already subscribed.
unsubscribeFromBus()
Unsubscribes this instance from the bus if subscribed.