Crate par_stream[−][src]
Expand description
Asynchronous parallel streams analogous to rayon.
The ParStreamExt and TryParStreamExt traits extends existing Streams with parallel stream combinators.
The followings are common combinators.
stream.par_then(limit, map_fut)
processes stream items to parallel futures.stream.par_map(limit, map_fn)
processes stream items to parallel closures.stream.par_then_unordered(limit, map_fut)
is unordered version ofstream.par_then
.stream.par_then_init(limit, init_fut, map_fut)
accepts an extra in-local thread initializer.stream.try_par_then(limit, map_fut)
is the fallible version ofstream.par_then
.
The limit
parameter configures the worker pool size. It accepts the following values.
None
: The worker pool size scales to the number of system CPUs, and double size of input buffer.10
or non-zero integers: Scales the worker pool size to absolute 10, and double size of input buffer.2.3
or non-zero floating points: Scale the number of workers to 2.3 times the number of system CPUs, and double size of input buffer.(10, 15)
: Scales to absolute 10 workers, and sets the input buffer size to 15.
Modules
Commonly used traits.
Structs
Parallel stream configuration.
Parallel stream parameters.
Enums
Sum type of absolute value and scaling value.
Traits
An extension trait for Stream that provides parallel combinator functions.
An extension trait for TryStream that provides parallel combinator functions.
Functions
Collect multiple streams into single stream.