Strom.Mixer (strom v0.9.3)
View SourceMix several streams into one. Use Strom.GenMix under the hood
## Example
iex> alias Strom.Mixer
iex> mixer = [:s1, :s2] |> Mixer.new(:stream) |> Mixer.start()
iex> flow = %{s1: [1, 2, 3], s2: [4, 5, 6]}
iex> %{stream: stream} = Mixer.call(flow, mixer)
iex> stream |> Enum.to_list() |> Enum.sort()
[1, 2, 3, 4, 5, 6]
Summary
Types
Functions
@spec call(Strom.flow(), t()) :: Strom.flow()
@spec new( [Strom.stream_name()] | %{required(Strom.stream_name()) => (event() -> as_boolean(any()))}, Strom.stream_name(), list() ) :: t()
@spec process_chunk(atom(), list(), Strom.flow(), nil) :: {Strom.flow(), boolean(), nil}
@spec stop(t()) :: :ok