T
- The type of messages to pass through the streampublic final class SyncDataflowBroadcast<T> extends DataflowStreamWriteAdapter<T>
Typical use:
DataflowWriteChannel broadcastStream = new DataflowBroadcast() DataflowReadChannel stream1 = broadcastStream.createReadChannel() DataflowReadChannel stream2 = broadcastStream.createReadChannel() broadcastStream << 'Message' assert stream1.val == stream2.val
Constructor and Description |
---|
SyncDataflowBroadcast()
Creates a new instance
|
Modifier and Type | Method and Description |
---|---|
DataflowReadChannel<T> |
createReadChannel()
Retrieves an implementation of DataflowReadChannel to read all messages submitted to the broadcast chanel.
|
java.lang.String |
toString() |
void |
unsubscribeReadChannel(DataflowReadChannel<T> channel)
Un-registers the supplied read channel from the broadcast.
|
bind, getHead, leftShift, leftShift
public java.lang.String toString()
toString
in class DataflowStreamWriteAdapter<T>
public DataflowReadChannel<T> createReadChannel()
public void unsubscribeReadChannel(DataflowReadChannel<T> channel) throws java.lang.InterruptedException
channel
- The channel to unsubscribe. The channel won't be able to read further messages.java.lang.InterruptedException
- If the thread got interrupted