Skip to content

Commit

Permalink
Added option to name GenServer
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewDryga committed May 10, 2017
1 parent b639151 commit 801aad4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/dogstat.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ defmodule DogStat do
* `namespace` - will be used as prefix to collected metrics;
* `send_tags?` - allows to disable tags for StatsD servers that don't support them;
* `sink` - if set to list, all metrics will be stored in a process state, useful for testing;
* `name` - worker process name.
"""
def start_link(opts) do
GenServer.start_link(__MODULE__, opts, name: __MODULE__)
name = Keyword.get(opts, :name, __MODULE__)
GenServer.start_link(__MODULE__, opts, name: name)
end

@doc false
Expand Down

0 comments on commit 801aad4

Please sign in to comment.