primrose.core

Core functions for primrose - A set of basic utility functions for working
with collections of futures and selecting 1, some or all their results.

There is currently no timeouts or error handling in place (and there really
should be)

all

(all & futures)
Return all the futures when they are fully realised.

A convenience method for `(select-many (fn [_] true) ...)` to avoid having to
write the boiler plate predicate

first

(first & futures)
Return the first future to be realised.

A convenience method for `(select-one (fn [_] true) ...)` to avoid having to
write the boiler plate predicate

select-many

(select-many predicate & futures)
Selects 0..N return values from the passed futures based on the given
predicate.  If all futures complete without matching the predicate an
empty seq is returned.

No timeout operations are supported internally so if a future fails to
return then neither will this method

select-one

(select-one predicate & futures)
Selects a single return value from one of the passed futures based on the
given predicate.  If all futures complete without matching the predicate
the returned promised will be satisifed with `nil`

No timeout operations are supported internally so if no future returns then
neither will this method.