GenServer.start/3 Dialyzer Issues in Flow.Coordinator
asummers opened this issue · 2 comments
asummers commented
In investigating Dialyzer errors, I found that after #80 and #81 the last remaining Dialyzer error stems from flow.ex
in the call
opts = [demand: :accumulate]
case Flow.Coordinator.start(flow, :producer_consumer, {:outer, fn _ -> [] end}, opts) do
which calls GenServer.start(__MODULE__, {flow, type, consumers, options}, options)
. Because :demand
is not a valid option for https://hexdocs.pm/elixir/GenServer.html#t:options/0, this makes Dialyzer upset. The call in Flow.Coordinator.start_link
has the same problem. The easiest way to make Dialyzer happy is simply to do something like:
filtered_options = Keyword.take(options, [:debug, :name, :timeout, :spawn_opt, :hibernate_after])
GenServer.start(__MODULE__, {flow, type, consumers, options}, filtered_options)
Is this something you'd be open to?
After this, #80 and #81, are all resolved Dialyzer can then be added to the CI process.
josevalim commented
Yup, this route sounds good!