StreamRunner
The StreamRunner
provides a convenient way to run a Stream
as process in a
supervisor tree.
To run a Stream
as a process simply pass the stream to StreamRunner.start_link/1
:
stream = Stream.interval(1_000) |> Stream.each(&IO.inspect/1)
{:ok, pid} = StreamRunner.start_link(stream)
Summary↑
start(stream, opts \\ []) | Start a |
start_link(stream, opts \\ []) | Start a |
Types ↑
debug_option :: :trace | :log | :statistics | {:log_to_file, Path.t}
Debug option values.
name :: atom | {:global, term} | {:via, module, term}
The name of the StreamRunner
.
option :: {:debug, [debug_option]} | {:name, name} | {:timeout, timeout} | {:spawn_opt, Process.spawn_opt}
StreamRunner
start_link/2
or start/2
option values.
on_start :: {:ok, pid} | :ignore | {:error, {:already_started, pid} | term}
start_link/2
or start/2
return values.
Functions
Start a StreamRunner
.
The StreamRunner
is not linked to the calling process.
Specs:
- start_link(Enumerable.t, [option]) :: on_start
Start a StreamRunner
as part of the supervision tree.