co.paralleluniverse.pulsar.lazyseq documentation

Functions to transform a channel into a laze seq

channel->lazy-seq

(channel->lazy-seq channel)(channel->lazy-seq channel timeout unit)
Turns a channel into a lazy-seq.

drop

(drop n coll)
Returns a lazy sequence of all but the first n items in coll.

filter

(filter pred coll)
Returns a lazy sequence of the items in coll for which
(pred item) returns true. pred must be free of side-effects.

lazy-seq

macro

(lazy-seq & body)
Takes a body of expressions that returns an ISeq or nil, and yields
a Seqable object that will invoke the body only the first time seq
is called, and will cache the result and return it on all subsequent
seq calls. See also - realized?

map

(map f coll)
Returns a lazy sequence consisting of the result of applying f to the
set of first items of each coll, followed by applying f to the set
of second items in each coll, until any one of the colls is
exhausted.  Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments.

repeatedly

(repeatedly f)(repeatedly n f)
Takes a function of no args, presumably with side effects, and
returns an infinite (or length n if supplied) lazy sequence of calls
to it

snd-seq

(snd-seq channel ms)
Sends a sequence of messages to a channel

take

(take n coll)
Returns a lazy sequence of the first n items in coll, or all items if
there are fewer than n.

take-while

(take-while pred coll)
Returns a lazy sequence of successive items from coll while
(pred item) returns true. pred must be free of side-effects.