Guest User

Untitled

a guest
Jul 20th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. % top-level supervisor
  2. -module (pool_sup).
  3. -behaviour (supervisor).
  4. -export ([ start_link/1, init/1 ]).
  5. start_link(Config) ->
  6. supervisor:start_link({local, ?MODULE}, ?MODULE, [Config]).
  7. init([PoolConfig]) ->
  8. { ok, { { one_for_one, 10, 10 },
  9. [
  10. { connection_sup,
  11. { connection_sup, start_link,
  12. [ proplists:get_value (connection_config,
  13. PoolConfig,
  14. { "127.0.0.1", 8087, [] }) ]
  15. }, permanent, 2000, supervisor, [ connection_sup ] },
  16. { pool_manager,
  17. { pool_manager, start_link,
  18. [ proplists:get_value (connection_num,
  19. PoolConfig,
  20. 10)
  21. ]
  22. }, permanent, 2000, worker, [ pool_manager ] } ]
  23. } }.
Add Comment
Please, Sign In to add comment