ch.bind.philib.msg.vm
public interface PubSub
| Modifier and Type | Method and Description |
|---|---|
Map<String,Integer> |
activeChannels()
Lists all channels with one or more subscriptions.
The returned Map is a representation of the state at the time of
the invocation of this method. |
void |
publishAsync(String channelName,
Object message) |
void |
publishSync(String channelName,
Object message) |
Subscription |
subscribe(String channelName,
MessageHandler handler)
subscribe a
MessageHandler to a channel. |
Subscription subscribe(String channelName, MessageHandler handler)
MessageHandler to a channel.channelName - handler - a non-null handlerSubscription object if this is a new message handler,
null otherwise.IllegalArgumentException - if the channelName parameter is null or empty
or if the handler parameter is null.void publishSync(String channelName, Object message)
channelName - message - the non-null message to be sentIllegalArgumentException - if the channelName parameter is null or empty
or if the message parameter is null.void publishAsync(String channelName, Object message)
channelName - message - the non-null message to be sentIllegalArgumentException - if the channelName parameter is null or empty
or if the message parameter is null.Map<String,Integer> activeChannels()
Map is a representation of the state at the time of
the invocation of this method. New subscriptions or cancelled
subscriptions which happen after the invocation of this method will not
be reflected in maps of previous queries.Map with active channel names as key and the number of
subscribers as value.Copyright © 2013. All Rights Reserved.