Skip to content

Commit

Permalink
Make pool options configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane Kilkelly committed Apr 3, 2018
1 parent d1be90f commit 8402c34
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/hammer/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ defmodule Hammer.Supervisor do

# Private helpers
defp to_pool_spec(name, {mod, args}) do
pool_size = args[:pool_size] || 4
pool_max_overflow = args[:pool_max_overflow] || 4

opts = [
name: {:local, name},
worker_module: mod,
size: 4, # TODO: make the pool size configurable
max_overflow: 4
size: pool_size,
max_overflow: pool_max_overflow
]

:poolboy.child_spec(name, opts, args)
Expand Down

0 comments on commit 8402c34

Please sign in to comment.