public class SourceQueue<M,D> extends java.lang.Object implements MessageSource<M,D>
| Constructor and Description |
|---|
SourceQueue()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<ChannelMessage<M,D>> |
dequeue()
Removes all the items currently in the queue, returning them in FIFO
order.
|
java.util.List<D> |
dequeueData()
Same as
dequeue() but discards message metadata. |
java.util.Optional<ChannelMessage<M,D>> |
head() |
java.util.Optional<D> |
headData()
Same as
head() but discards message metadata. |
void |
send(ChannelMessage<M,D> msg)
Inputs data into the channel and returns immediately.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasDataSourceuncheckedSendpublic void send(ChannelMessage<M,D> msg) throws java.lang.Exception
ChannelSourcesend in interface ChannelSource<ChannelMessage<M,D>>msg - the message to send.java.lang.NullPointerException - if the input is null.java.lang.Exception - if the data could not be input into the channel.public java.util.Optional<ChannelMessage<M,D>> head()
public java.util.Optional<D> headData()
head() but discards message metadata.public java.util.List<ChannelMessage<M,D>> dequeue()