abstract class Concurrent::Stream::Base(T)
- Concurrent::Stream::Base(T)
- Reference
- Object
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.
Included Modules
- Concurrent::Stream::Receive
Direct Known Subclasses
- Concurrent::Stream::Batch(S, D)
- Concurrent::Stream::Map(S, D)
- Concurrent::Stream::Run(S)
- Concurrent::Stream::Select(S)
- Concurrent::Stream::Source(T)
- Concurrent::Stream::Tee(S)
Defined in:
concurrent/stream.crConstructors
Instance Method Summary
-
#batch(size : Int32)
Parallel batch.
- #close : Nil
-
#map(*, fibers : Int32? = nil, &block : T -> U) forall U
Parallel map.
-
#run(*, fibers : Int32? = nil, &block : T -> _)
Parallel run.
-
#select(*, fibers : Int32? = nil, &block : T -> Bool)
Parallel select.
- #serial
-
#tee(*, fibers : Int32? = nil, &block : T -> _)
Parallel tee.
- #to_a(*args, **options)
- #to_a(*args, **options, &)
- #wait(*args, **options)
- #wait(*args, **options, &)
Instance methods inherited from module Concurrent::Stream::Receive
handle_error(ex, src_vch, src_ech, dst_ech)
handle_error
Constructor Detail
Instance Method Detail
def batch(size : Int32)
#
Parallel batch. Runs in a single fiber. Multiple fibers would delay further stream processing.
def map(*, fibers : Int32? = nil, &block : T -> U) forall U
#
Parallel map. &block
is evaluated in a fiber pool.
def run(*, fibers : Int32? = nil, &block : T -> _)
#
Parallel run. &block
is evaluated in a fiber pool.
Further processing is not possible except for #wait.
def select(*, fibers : Int32? = nil, &block : T -> Bool)
#
Parallel select. &block
is evaluated in a fiber pool.
def tee(*, fibers : Int32? = nil, &block : T -> _)
#
Parallel tee. &block
is evaluated in a fiber pool.
The original message is passed to the next Stream.