class

X::Supervisor::Context

Inherits Reference / Object

Supervisor manages a set of child processes according to a restart strategy

Constants

Log = ::Log.for(self)

Constructors

new(engine : Engine::Context, address : UInt64, strategy : RestartStrategy = RestartStrategy::OneForOne, max_restarts : Int32 = 3, restart_window : Time::Span = 5.seconds)
Source

Instance methods

add_child(specification : Child::Specification) : UInt64 | Nil

Add a child specification

Source
address
Source
child_status

Get status of all children

Source
children
Source
handle_child_exit(process_id : UInt64, reason : Process::Reason::Context) : Bool

Handle a child exit

Source
max_restarts
Source
restart_histories
Source
restart_window
Source
running_children

Get count of running children

Source
shutdown

Shut down the supervisor and all children

Source
strategy
Source
whereis(child_id : String) : UInt64 | Nil

Get the process_id of a child by id

Source