diff options
| author | Tim Watson <tim@rabbitmq.com> | 2013-04-05 13:28:30 +0100 |
|---|---|---|
| committer | Tim Watson <tim@rabbitmq.com> | 2013-04-05 13:28:30 +0100 |
| commit | 2d7e253cd6d6ede93be67a1631a57d63380aea0c (patch) | |
| tree | 0875f4db8c7394f09f26e41c44f44816852fdf9f /src | |
| parent | 7339260059b0efca30fbf7f5335c6418077c60f8 (diff) | |
| parent | af04fb7a597f9c02cfd83dcdd8ceff123327850d (diff) | |
| download | rabbitmq-server-git-2d7e253cd6d6ede93be67a1631a57d63380aea0c.tar.gz | |
merge bug25487 into default
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_client_sup.erl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/rabbit_client_sup.erl b/src/rabbit_client_sup.erl index 9602c51248..7cc11fef57 100644 --- a/src/rabbit_client_sup.erl +++ b/src/rabbit_client_sup.erl @@ -18,7 +18,7 @@ -behaviour(supervisor2). --export([start_link/1, start_link/2]). +-export([start_link/1, start_link/2, start_link_worker/2]). -export([init/1]). @@ -32,6 +32,8 @@ rabbit_types:ok_pid_or_error()). -spec(start_link/2 :: ({'local', atom()}, rabbit_types:mfargs()) -> rabbit_types:ok_pid_or_error()). +-spec(start_link_worker/2 :: ({'local', atom()}, rabbit_types:mfargs()) -> + rabbit_types:ok_pid_or_error()). -endif. @@ -43,6 +45,12 @@ start_link(Callback) -> start_link(SupName, Callback) -> supervisor2:start_link(SupName, ?MODULE, Callback). +start_link_worker(SupName, Callback) -> + supervisor2:start_link(SupName, ?MODULE, {Callback, worker}). + init({M,F,A}) -> {ok, {{simple_one_for_one_terminate, 0, 1}, - [{client, {M,F,A}, temporary, infinity, supervisor, [M]}]}}. + [{client, {M,F,A}, temporary, infinity, supervisor, [M]}]}}; +init({{M,F,A}, worker}) -> + {ok, {{simple_one_for_one_terminate, 0, 1}, + [{client, {M,F,A}, temporary, ?MAX_WAIT, worker, [M]}]}}. |
