Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % top-level supervisor
- -module (pool_sup).
- -behaviour (supervisor).
- -export ([ start_link/1, init/1 ]).
- start_link(Config) ->
- supervisor:start_link({local, ?MODULE}, ?MODULE, [Config]).
- init([PoolConfig]) ->
- { ok, { { one_for_one, 10, 10 },
- [
- { connection_sup,
- { connection_sup, start_link,
- [ proplists:get_value (connection_config,
- PoolConfig,
- { "127.0.0.1", 8087, [] }) ]
- }, permanent, 2000, supervisor, [ connection_sup ] },
- { pool_manager,
- { pool_manager, start_link,
- [ proplists:get_value (connection_num,
- PoolConfig,
- 10)
- ]
- }, permanent, 2000, worker, [ pool_manager ] } ]
- } }.
Add Comment
Please, Sign In to add comment