Skip to content

Commit

Permalink
allow GenServer options to be passed-in for producer
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivy Rogatko authored and Ivy Rogatko committed Dec 4, 2019
1 parent 270f78d commit 61bed37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/nsq/producer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ defmodule NSQ.Producer do
# ------------------------------------------------------- #
# API Definitions #
# ------------------------------------------------------- #
@spec start_link(binary, NSQ.Config.t) :: {:ok, pid}
def start_link(topic, config) do
@spec start_link(binary, NSQ.Config.t, GenServer.options) :: {:ok, pid}
def start_link(topic, config, genserver_options \\ []) do
{:ok, config} = NSQ.Config.validate(config || %NSQ.Config{})
{:ok, config} = NSQ.Config.normalize(config)
unless is_valid_topic_name?(topic), do: raise "Invalid topic name #{topic}"
state = %{@initial_state | topic: topic, config: config}
GenServer.start_link(__MODULE__, state)
GenServer.start_link(__MODULE__, state, genserver_options)
end


Expand Down

0 comments on commit 61bed37

Please sign in to comment.