Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % connection supervisor
- -module (connection_sup).
- -behaviour (supervisor).
- -export ([start_link/1, start_connection/0, init/1]).
- start_link({Ip, Port, Options}) ->
- supervisor:start_link({local, ?MODULE}, ?MODULE, [Ip, Port, Options]).
- start_connection () ->
- supervisor:start_child (?MODULE, []).
- init([Ip, Port, Options]) ->
- { ok, { { simple_one_for_one, 10, 10 },
- [ { connections,
- { pool_manager, start_connection, [Ip, Port, Options] },
- transient, 2000, worker, dynamic
- }
- ]
- } }.
Add Comment
Please, Sign In to add comment