> If called with this value, this means that the monitor instance terminated because it finished calling onload or a listener and has no active listeners or streaming elements left.
subscribe
void static subscribe(string channelName)
Subscribe the calling context to the specified channel.
All listeners in the same context as the calling monitor instance (including in other monitor instances) will receive and process events sent to the specified channel. The calling monitor instance owns the subscription. If the calling monitor instance terminates, the subscription ends.
Multiple monitor instances in the same context can subscribe to the same channel. Each event is delivered exactly once as long as any of the subscriptions are active. An event is not delivered once for each subscription.
-
Parameters:
-
channelName - The channel name to subscribe to.
unsubscribe
void static unsubscribe(string channelName)
Remove the subscription to the specified channel that this monitor instance has in the calling context.
If this was the last monitor instance subscribed to the channel, then the context will no longer receive or process events sent to this channel.
-
Parameters:
-
channelName - The channel name to unsubscribe from.
-
Throws:
- Throws IllegalStateException if you attempt to unsubscribe from a channel the monitor instance was not subscribed to.