Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken match in Wabbit.GenStage.noreply_callback #15

Open
h4cc opened this issue Mar 14, 2018 · 0 comments
Open

Broken match in Wabbit.GenStage.noreply_callback #15

h4cc opened this issue Mar 14, 2018 · 0 comments

Comments

@h4cc
Copy link

h4cc commented Mar 14, 2018

There is a bug in this function:
https://github.com/pma/wabbit/blob/master/lib/wabbit/gen_stage.ex#L271

There is not "module" key in state:
https://github.com/pma/wabbit/blob/master/lib/wabbit/gen_stage.ex#L6

Fix could look like this:

  defp noreply_callback(callback, args, %__MODULE__{mod: module} = state) do
    handle_noreply_callback apply(module, callback, args), state
  end

Hint: Using %__MODULE__{} for matches will let the compiler validate keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant