Created
December 12, 2019 19:39
-
-
Save x-ji/699425a103dc0fac61d3c0a12f506ea1 to your computer and use it in GitHub Desktop.
Markdium-Elixir process orchestration in Kubernetes with libcluster and swarm
This file contains 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 characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment