T - The type of message that the RedisBroadcastChannel publishes@Singleton public class RedisBroadcastChannel<T> extends Object implements BroadcastChannel<T>
PUBLISH_ON_CLOSED_ERROR_MESSAGE| Constructor and Description |
|---|
RedisBroadcastChannel(org.redisson.api.RedissonClient redissonClient)
Builds a Broadcastchannel that knows how to communicate with Redis.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
rx.Observable<T> |
getNotifications()
This method returns a Hot Observable (Observable which emits events whether someone is listening or not) that
emits all the notifications passed to it by Bard instances in the cluster.
|
void |
publish(T message)
Publish is used to publish a message from a Bard box.
|
public RedisBroadcastChannel(org.redisson.api.RedissonClient redissonClient)
redissonClient - The client to use to communicate with Redispublic void publish(T message) throws UnsupportedOperationException
BroadcastChannelpublish in interface BroadcastChannel<T>message - The message to be publishedUnsupportedOperationException - if someone attempts to publish to the channel after it has been closedpublic rx.Observable<T> getNotifications()
BroadcastChannelgetNotifications in interface BroadcastChannel<T>public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.