Created
December 12, 2019 19:39
-
-
Save x-ji/699425a103dc0fac61d3c0a12f506ea1 to your computer and use it in GitHub Desktop.
Revisions
-
x-ji created this gist
Dec 12, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # Change the handling of :begin_handoff # This is triggered whenever a registered process is to be killed. def handle_call({:swarm, :begin_handoff}, _from, current_state) do {:reply, {:resume, produce_outgoing_state(current_state)}, current_state} end # Handle :end_handoff # This is triggered whenever a process has been restarted on a new node. def handle_call({:swarm, :end_handoff, incoming_state}, _from, current_state) do {:noreply, end_handoff_new_state(current_state, incoming_state)} end