class

Arcana::Supervisor

Inherits Reference < Object

Monitors actors and restarts them on crash.

Follows OTP supervision principles: actors are expected to crash, and the supervisor brings them back.

sup = Arcana::Supervisor.new(bus, dir, strategy: :one_for_one, max_restarts: 3, within: 5.seconds, ) sup.supervise(agent1) sup.supervise(agent2) sup.start

Constructors

new(bus : Bus, directory : Directory, strategy : Strategy = Strategy::OneForOne, max_restarts : Int32 = 3, within : Time::Span = 5.seconds)
Source

Instance methods

children

List supervised actor addresses.

Source
start

Start all supervised actors.

Source
stop

Stop all supervised actors.

Source
strategy
Source
supervise(actor : Actor)

Add an actor to be supervised. Registers and starts it.

Source

Nested types