Make a concurrent stream evaluator from a stream, to be used in withChannelK or toChannelK. Maps a stream generation function on each element of the stream, the evaluation of the map on each element happens concurrently. All the generated streams are merged together in the output of the channel. The scheduling and termination behavior depends on the channel settings.
Note that if you queue a stream on the channel using toChannelK, it will
be picked up by a worker and the worker would evaluate the entire stream
serially and emit the results on the channel. However, if you transform the
stream using parConcatMapChanK and queue it on the channel, it
parallelizes the function map on each element of the stream. The simplest
example is parConcatMapChanK id id which is equivalent to evaluating each
element of the stream concurrently.
A channel worker evaluating this function would enqueue the tail on the channel's work queue and go on to evaluate the head generating an output stream. The tail is picked up by another worker which does the same and so on.