diff options
author | kballou <kballou@devnulllabs.io> | 2014-10-16 19:22:50 -0600 |
---|---|---|
committer | kballou <kballou@devnulllabs.io> | 2014-10-20 16:28:38 -0600 |
commit | ccc7ba834e11b0da450800a8695954baee9c06b7 (patch) | |
tree | ce9f64744ca8fdeaa184b139eb70364e9c331946 /lib/poolparty/supervisor.ex | |
parent | 226970e89bb4b8b32c2c08c2ef2999a3e8e4abbd (diff) | |
download | poolparty-ccc7ba834e11b0da450800a8695954baee9c06b7.tar.gz poolparty-ccc7ba834e11b0da450800a8695954baee9c06b7.tar.xz |
PoolParty Scheduler, supervisor, and workers
Add PoolParty supervisor, scheduler, pool supervisor, and pool
workers
Diffstat (limited to 'lib/poolparty/supervisor.ex')
-rw-r--r-- | lib/poolparty/supervisor.ex | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/poolparty/supervisor.ex b/lib/poolparty/supervisor.ex new file mode 100644 index 0000000..2f4d150 --- /dev/null +++ b/lib/poolparty/supervisor.ex @@ -0,0 +1,14 @@ +defmodule PoolParty.Supervisor do + use Supervisor + + def start_link(opts \\ []) do + Supervisor.start_link(__MODULE__, {}, [name: __MODULE__] ++ opts) + end + + def init(_) do + pool_size = Application.get_env(:poolparty, :pool_size) + children = [worker(PoolParty.Scheduler, [pool_size]), + worker(PoolParty.Pool.Supervisor, [pool_size])] + supervise(children, strategy: :one_for_one) + end +end |