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

Receive options on queue subscribe and pass to basic consume #164

Merged
merged 2 commits into from
Apr 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/amqp/queue.ex
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ defmodule AMQP.Queue do

This convenience function will spawn a process and register it using AMQP.Basic.consume.
"""
@spec subscribe(Channel.t(), Basic.queue(), (String.t(), map -> any)) ::
@spec subscribe(Channel.t(), Basic.queue(), (String.t(), map -> any), keyword) ::
{:ok, String.t()} | Basic.error()
def subscribe(%Channel{} = channel, queue, fun) when is_function(fun, 2) do
def subscribe(%Channel{} = channel, queue, fun, options \\ []) when is_function(fun, 2) do
consumer_pid = spawn(fn -> do_start_consumer(channel, fun) end)
Basic.consume(channel, queue, consumer_pid)
Basic.consume(channel, queue, consumer_pid, options)
end

defp do_start_consumer(channel, fun) do
Expand Down