Skip to content

Instantly share code, notes, and snippets.

@x-ji
Created December 12, 2019 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x-ji/872f8358553326d48e9aea76c255b8ff to your computer and use it in GitHub Desktop.
Save x-ji/872f8358553326d48e9aea76c255b8ff to your computer and use it in GitHub Desktop.
Markdium-Elixir process orchestration in Kubernetes with libcluster and swarm
defmodule Yourapp.YourSupervisor do
use DynamicSupervisor
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
def start_link(state) do
DynamicSupervisor.start_link(__MODULE__, state, name: __MODULE__)
end
def init(_) do
DynamicSupervisor.init(strategy: :one_for_one)
end
def register(worker_name) do
DynamicSupervisor.start_child(__MODULE__, worker_name)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment