This is an oversimplified example, but I’m trying to figure out how to create a GenStage
producer that can signal completion to GenStage.stream
without causing the consuming process to exit.
Here’s my example (adapted from my doctest):
iex> {:ok, stage} = GenStage.from_enumerable(["Hello", "World"])
iex> GenStage.stream([stage]) |> Enum.to_list()
{"Hello", "World"}
… but this test fails with:
** (exit) exited in: GenStage.close_stream(%{})
** (EXIT) normal
What am I missing?