Packages

Observables in the spirit of Reactive Extensions for Elixir, extended with advanced primitives for combination and classic reactive programming.

Current section

Files

Jump to
observables_extended lib observables supervisor.ex
Raw

lib/observables/supervisor.ex

defmodule Observables.Supervisor do
@moduledoc false
use Supervisor
def start_link(arg \\ []) do
DynamicSupervisor.start_link(__MODULE__, arg, name: __MODULE__)
end
def init(_arg) do
DynamicSupervisor.init(strategy: :one_for_one)
end
def add_child(module, opts) do
spec = Supervisor.Spec.worker(module, opts, restart: :transient)
DynamicSupervisor.start_child(__MODULE__, spec)
end
end