ParallelStream.Mapper

The map iterator implementation

Summary

Functions

Creates a stream that will apply the given function on enumeration in parallel and return the functions return value

Functions

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

Creates a stream that will apply the given function on enumeration in parallel and return the functions return value.

Options

These are the options:

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

Examples

Map and duplicate the numbers:

iex> parallel_stream = 1..5 |> ParallelStream.map(fn i -> i * 2 end)
iex> parallel_stream |> Enum.to_list
[2, 4, 6, 8, 10]