co.paralleluniverse.pulsar.rx

Functions transform channels

fiber-transform

(fiber-transform in out f)
Spawns a fiber that runs the supplied function `f`, which is passed the
supplied receive-port `in` and send-port `out`

filter

(filter pred ch)
Creates a receive-port (a read-only channel) that filters messages that satisfy the predicate pred
from the given channel ch.
 All messages (even those not satisfying the predicate) will be consumed from the original channel;
 those that don't satisfy the predicate will be silently discarded.

group

(group ports)(group port & ports)
Creates a receive-port (a read-only channel) from a group of channels.
Receiving a message from the group will return the next message available from
any of the channels in the group.
A message received from the group is consumed (removed) from the original member
channel to which it has been sent.

map

(map f ch)
Creates a receive-port (a read-only channel) that receives messages that are transformed by the
given mapping function f from a given channel ch.

mapcat

(mapcat f ch)
Creates a receive-port (a read-only channel) that receives messages that are transformed by the
given mapping function f from a given channel ch.

Unlike map, the mapping function may return a single value, a sequence of values or a channel, and
in all cases the values contained in the sequence/channel will be received one at a time by the returned
receive-port.

snd-filter

(snd-filter pred ch)
Returns a channel that filters messages that satisfy the predicate pred before sending to the given channel ch.
Messages that don't satisfy the predicate will be silently discarded when sent.

snd-map

(snd-map f ch)
Returns a channel that transforms messages by applying the given mapping function f
before sending them to the given channel ch.

snd-mapcat

(snd-mapcat f ch pipe)
Creates a send-port that sends messages that are transformed by the
given mapping function f from a given channel ch.

Unlike map, the mapping function may return a single value, a sequence of values or a channel, and
in all cases the values contained in the sequence/channel will be sent one at a time to the channel.
receive-port. If multiple producers write to the channel, the messages received from the mapped
collections/channels may be interleaved with messages produced by other producers.

The `pipe` parameter is an intermediate channel used by the operation.

zip

(zip c & cs)
Creates a receive-port (a read-only channel) that combines messages from the given channels
into a single combined vector message.