Created
December 12, 2019 19:39
-
-
Save x-ji/872f8358553326d48e9aea76c255b8ff to your computer and use it in GitHub Desktop.
Markdium-Elixir process orchestration in Kubernetes with libcluster and swarm
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 characters
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