diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mirrored_supervisor.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mirrored_supervisor.erl b/src/mirrored_supervisor.erl index 97a68e9608..1e84bf0a12 100644 --- a/src/mirrored_supervisor.erl +++ b/src/mirrored_supervisor.erl @@ -280,12 +280,12 @@ init({delegate, Restart}) -> init({mirroring, Group, ChildSpecs}) -> ?PG2:create(Group), + ok = ?PG2:join(Group, self()), [begin - gen_server2:call(Pid, {hello, self()}, infinity), + gen_server2:cast(Pid, {ensure_monitoring, self()}), erlang:monitor(process, Pid) end - || Pid <- ?PG2:get_members(Group)], - ok = ?PG2:join(Group, self()), + || Pid <- ?PG2:get_members(Group) -- [self()]], {ok, #state{group = Group, initial_childspecs = ChildSpecs}}. handle_call({finish_startup, Overall}, _From, @@ -306,16 +306,16 @@ handle_call({delete_child, Id}, _From, handle_call({msg, F, A}, _From, State = #state{overall = Overall}) -> {reply, apply(?SUPERVISOR, F, [child(Overall, delegate) | A]), State}; -handle_call({hello, Pid}, _From, State) -> - erlang:monitor(process, Pid), - {reply, ok, State}; - handle_call(overall_supervisor, _From, State = #state{overall = Overall}) -> {reply, Overall, State}; handle_call(Msg, _From, State) -> {stop, {unexpected_call, Msg}, State}. +handle_cast({ensure_monitoring, Pid}, State) -> + erlang:monitor(process, Pid), + {noreply, State}; + handle_cast(Msg, State) -> {stop, {unexpected_cast, Msg}, State}. |
