-
Notifications
You must be signed in to change notification settings - Fork 178
Fix Elixir 1.20 warnings #377
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -292,7 +292,7 @@ defmodule Broadway.Topology.ProducerStage do | |
|
|
||
| defp maybe_rate_limit_and_buffer_messages(state, messages) do | ||
| if state.rate_limiting && messages != [] do | ||
| state = update_in(state.rate_limiting.message_buffer, &enqueue_batch(&1, messages)) | ||
| state = update_in(state.rate_limiting.message_buffer, &:queue.in(messages, &1)) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I personally prefer to remove the helper function altogether since this is the only call site and the direct call is pretty straightforward. We check that the messages are not empty right on the line above this one, so the compiler was right obviously. |
||
| rate_limit_and_buffer_messages(state) | ||
| else | ||
| {state, messages} | ||
|
|
@@ -372,9 +372,6 @@ defmodule Broadway.Topology.ProducerStage do | |
| end | ||
| end | ||
|
|
||
| defp enqueue_batch(queue, _list = []), do: queue | ||
| defp enqueue_batch(queue, list), do: :queue.in(list, queue) | ||
|
|
||
| defp enqueue_batch_r(queue, _list = []), do: queue | ||
| defp enqueue_batch_r(queue, list), do: :queue.in_r(list, queue) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| ExUnit.start(capture_log: true, assert_receive_timeout: 2000) | ||
| Logger.remove_backend(:console) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing this doesn't change any test output when running on later Elixir versions, so I think we should be okay with just getting rid of this. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good but maybe we just bump to a more recent OTP version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're on Elixir 1.7 here (😄) so I didn't wanna touch that but yeah I'd be ok to do that (in a follow-up PR?).