Hi Marc,
Yes, this may be a bit cryptic mostly because I've never managed to document it clearly.
There are two kinds of channels:
- dataflow stream (or queue)
- dataflow value (or singleton)
The first works as you've described. A stream channel is basically an asynchronous FIFO queue or a stream of items. Thus when an item is read, it is removed from the channel.
The second has a different semantic. By definition a dataflow variable is a partial data structure that can be assigned to one and only one value [1]. Thus, once assigned (or bounded in the dataflow parlance), it will return always the same value (or the empty value) when you will read it i.e. is never consumed.
So the question is: how distinguish these two types of channels? A value channel is created by the channel factory
Channel.value() or by an operator that returns a single value e.g.
first(),
last(),
count(),
toList(), etc.
All the remaining channels are dataflow queues that emit a sequence of values.
Does it clarify your doubt?
Cheers,
Paolo