View Source Siblings.Lookup (Siblings v0.11.3)
The instance of FSM backed up by Finitomata
.
fsm-representation
FSM representation
graph TD
idle --> |initialize| ready
ready --> |start_child| ready
ready --> |delete_child| ready
ready --> |terminate| terminated
Link to this section Summary
Functions
Getter for the internal compiled in FSM information.
Returns all the workers running under this Siblings
instance as a map
%{Siblings.Worker.id() => pid()}
.
Returns a specification to start this module under a supervisor.
The convenient macro to allow using states in guards, returns a compile-time
list of states for Siblings.Lookup
.
Removes the reference for the naturally terminated child from the workers map
through :delete_child
transition with all the respective callbacks.
Returns the pid
of the single dynamically supervised worker by its id
.
Initiates the :start_child
transition with all the respective callbacks
to add a new child to the supervised list.
Starts an FSM alone with name
and payload
given.
Link to this section Types
@type state() :: :terminated | :ready | :idle | :*
Kind of event which might be send to initiate the transition.
fsm-representation
FSM representation
graph TD
idle --> |initialize| ready
ready --> |start_child| ready
ready --> |delete_child| ready
ready --> |terminate| terminated
Link to this section Functions
Getter for the internal compiled in FSM information.
@spec all(module()) :: %{required(Siblings.Worker.id()) => pid()}
Returns all the workers running under this Siblings
instance as a map
%{Siblings.Worker.id() => pid()}
.
This map might be really huge when there are many processes managed.
Returns a specification to start this module under a supervisor.
See Supervisor
.
The convenient macro to allow using states in guards, returns a compile-time
list of states for Siblings.Lookup
.
@spec del(module(), Siblings.Worker.id()) :: :ok
Removes the reference for the naturally terminated child from the workers map
through :delete_child
transition with all the respective callbacks.
Returns the pid
of the single dynamically supervised worker by its id
.
@spec put(module(), Siblings.worker()) :: :ok
Initiates the :start_child
transition with all the respective callbacks
to add a new child to the supervised list.
Starts an FSM alone with name
and payload
given.
Usually one does not want to call this directly, the most common way would be
to start a Finitomata
supervision tree or even better embed it into
the existing supervision tree and start FSM with Finitomata.start_fsm/3
passing Siblings.Lookup
as the first parameter.