defp gen_stage_to_stream(pid) when is_pid(pid) do
GenStage.stream([pid])
end
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/899f7862-b5dd-445e-9bff-265fb0587511%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
def stream(subscription, options) when is_pid(subscription) do
GenStage.stream([subscription], options)
end
Your code is perfect as is. Small private functions are really helpful so keep doing it. We don't plan to change GenStage. :)
On Wed, Oct 26, 2016 at 5:03 AM, <er...@scouten.com> wrote:
While I understand the desire to make a stream out of multiple GenStages, I find myself writing this snippet of code frequently …
defp gen_stage_to_stream(pid) when is_pid(pid) do
GenStage.stream([pid])
end
… so I can then use the stream in a pipe chain.This seems a bit cumbersome. Any hope for a version of GenStage.stream that accepts a single pid outside of a list?I'm open to writing a PR if the team is amenable to this.-Eric
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.