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.
Applies a function that generates a spool to each element in this spool, flattening the result into a single spool.
Eagerly executes all computation represented by this Spool (presumably for sideeffects), 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}}.
The first element of the spool if it is non-empty.
Applies a function that generates a Future[B] to each element of this spool The returned future is satisfied with the head of the resulting spool is available
Take the first n elements of the Spool as another Spool (adapted from Stream.
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.
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.
A spool is an asynchronous stream. It more or less mimics the scala {{Stream}} collection, but with cons cells that have either eager or deferred tails.
Construction of eager Spools is done with either Spool.cons or the {{**::}} operator. To construct a lazy/deferred Spool which materializes its tail on demand, use the {{*::}} operator. In order to use these operators for deconstruction, they must be imported explicitly (ie: {{import Spool.{*::, **:: }}} )
explicitly (ie: {{import Spool.{*::, **:: }}}