abstract class Concurrent::Stream::SendRecv(B, V, E, SC)
Overview
#map
, #select
, #run
and #tee
run in a fiber pool.
#batch
runs in a single fiber
All other methods "join" in the calling fiber.
Exceptions are raised in #each when joined.
TODO better error handling. B=block V=value E=accumulated_error SC=scope
Included Modules
- Concurrent::Stream::Receive(E)
Direct Known Subclasses
- Concurrent::Stream::Batch(SV, DV, E)
- Concurrent::Stream::Errors(B, S)
- Concurrent::Stream::Map(S, D, E, SC)
- Concurrent::Stream::Scope(S, E, SC)
- Concurrent::Stream::Select(S, E)
- Concurrent::Stream::Source(T, E)
- Concurrent::Stream::Tee(S, E)
Defined in:
concurrent/stream.crConstructors
Instance Method Summary
-
#batch(size : Int32, *, flush_interval : Float | Nil = nil, flush_empty : Bool = false)
Groups results in to chunks up to the given size.
- #close : Nil
- #errors(*, fibers : Int32 | Nil = nil, &block : Exception, E -> Nil)
-
#map(*, fibers : Int32 | Nil = nil, &block : V -> U) forall U
Parallel map.
-
#run(*, fibers : Int32 | Nil = nil, &block : V -> _)
Parallel run.
-
#scope(&block : -> U) forall U
Further processing is evaluated within the scope of the returned object.
-
#select(*, fibers : Int32 | Nil = nil, &block : V -> Bool)
Parallel select.
- #serial
-
#tee(*, fibers : Int32 | Nil = nil, &block : V -> _)
Parallel tee.
- #to_a(*args, **options)
- #to_a(*args, **options, &)
Instance methods inherited from class Concurrent::Stream::Base
close : Nil
close
Constructor methods inherited from class Concurrent::Stream::Base
new(*, fibers : Int32, parent : Concurrent::Stream::Base | Nil)
new
Constructor Detail
Instance Method Detail
Groups results in to chunks up to the given size. Runs in a single fiber. Multiple fibers would delay further stream processing.
Parallel map. &block
is evaluated in a fiber pool.
Parallel run. &block
is evaluated in a fiber pool.
Further processing is not possible except for #wait.
Further processing is evaluated within the scope of the returned object.
Parallel select. &block
is evaluated in a fiber pool.
Parallel tee. &block
is evaluated in a fiber pool.
The original message is passed to the next Stream.