The first element of the spool.
The first element of the spool. Invalid for empty spools.
The (deferred) tail of the spool.
The (deferred) tail of the spool. Invalid for empty spools.
Concatenates two spools.
Concatenates two spools.
Concatenates two spools.
Concatenates two spools.
The standard Scala collect, in order to implement map & filter.
The standard Scala collect, in order to implement map & filter.
It may seem unnatural to return a Future[…] here, but we cannot know whether the first element exists until we have applied its filter.
operator ++
operator ++
Builds a new Spool from this one by filtering out duplicate elements, elements for which fn returns the same value.
Builds a new Spool from this one by filtering out duplicate elements, elements for which fn returns the same value.
NB: this has space consumption O(N) of the number of distinct items
Applies a function that generates a spool for each element in this spool, flattening the result into a single spool.
Applies a function that generates a spool for each element in this spool, flattening the result into a single spool.
Eagerly executes all computation represented by this Spool (presumably for side-effects), and returns a Future representing its completion.
Eagerly executes all computation represented by this Spool (presumably for side-effects), and returns a Future representing its completion.
Apply {{f}} for each item in the spool, until the end.
Apply {{f}} for each item in the spool, until the end. {{f}} is applied as the items become available.
A version of {{foreach}} that wraps each element in an {{Option}}, terminating the stream (EOF) with {{None}}.
A version of {{foreach}} that wraps each element in an {{Option}}, terminating the stream (EOF) with {{None}}.
The first element of the spool if it is non-empty.
The first element of the spool if it is non-empty.
Applies a function that generates a Future[B] for each element of this spool.
Applies a function that generates a Future[B] for each element of this spool. The returned future is satisfied when the head of the resulting spool is available.
Take the first n elements of the Spool as another Spool (adapted from Stream.take)
Take the first n elements of the Spool as another Spool (adapted from Stream.take)
Take elements from the head of the Spool (lazily), while the given condition is true.
Take elements from the head of the Spool (lazily), while the given condition is true.
Fully buffer the spool to a {{Seq}}.
Fully buffer the spool to a {{Seq}}. The returned future is satisfied when the entire result is ready.
Zips two Spools returning a Spool of Tuple2s.
Abstract
Spool
class for Java compatibility.