T - The type of message that the SimpleBroadcastChannel publishes@Singleton public class SimpleBroadcastChannel<T> extends Object implements BroadcastChannel<T>
PUBLISH_ON_CLOSED_ERROR_MESSAGE| Constructor and Description |
|---|
SimpleBroadcastChannel(rx.subjects.Subject<T,T> notifications)
Construct a SimpleBroadcastChannel using a Hot Observable.
|
| 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 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.