ParallelStream.Each

The each iterator implementation

Summary

Functions

Creates a stream that will apply the given function on enumeration in parallel. The functions return value will be thrown away, hence this is useful for producing side-effects

Functions

each(stream, mapper, options \\ [])

Creates a stream that will apply the given function on enumeration in parallel. The functions return value will be thrown away, hence this is useful for producing side-effects.

Options

These are the options:

  • :num_pipes – The number of parallel operations to run when running the stream.

Examples

Iterate and write the numbers to stdout:

iex> parallel_stream = 1..5 |> ParallelStream.each(&IO.write/1)
iex> parallel_stream |> Enum.to_list
12345
[1,2,3,4,5]