elixir-lang / gen_stage

Producer and consumer actors with back-pressure for Elixir
http://hexdocs.pm/gen_stage
1.51k stars 192 forks source link

Make :subscribe_to option type less restrictive #261

Closed bamorim closed 4 years ago

bamorim commented 4 years ago

Addresses #260

The type of the :subscribe_to option for :consumers and :producer_consumers was changed to document that pid(), {:via, module(), term() and {:global, term()} are accepted as well, but only if the tuple versions are wrapped with options {name, options} so to avoid ambiguity if someone tries to have a {:global, term()} where term() is a list.

In order to enforce that and allow existing codebases to avoid surprises, a warning about deprecation was added in case {:via, module(), term()} or {:global, term()} was passed directly without wrapping with options.

josevalim commented 4 years ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart: