class Earl::Supervisor
- Earl::Supervisor
- Reference
- Object
Overview
Supervises other agents.
- Spawns agents in their dedicated Fiber.
- Recycles and restarts crashed agents.
- Eventually stops when all agents have stopped.
Included Modules
Direct Known Subclasses
Defined in:
supervisor.crConstructors
Instance Method Summary
- 
        #call
        
          Spawns all agents to supervise in their dedicated Fiber.
- 
        #monitor(agent : Agent) : Nil
        
          Adds an agent to supervise. 
- 
        #reset : Nil
        
          Recycles all supervised agents. 
- 
        #terminate : Nil
        
          Asks all supervised agents to stop. 
- 
        #trap(agent : Agent, exception : Exception | Nil) : Nil
        
          Recycles and restarts crashed agents. 
Instance methods inherited from module Earl::Logger
  
  
    
      log
    log
    
  
    
    
  Class methods inherited from module Earl::Logger
  
  
    
      backends : Array(Backend)
    backends, 
    
  
    
      debug(agent : Agent, message : String) : Nildebug(agent : Agent, &block : -> String) : Nil debug, debug? : Bool debug?, error(agent : Agent, message : String) : Nil
error(agent : Agent, &block : -> String) : Nil
error(agent : Agent, ex : Exception) error, error? : Bool error?, info(agent : Agent, message : String) : Nil
info(agent : Agent, &block : -> String) : Nil info, info? : Bool info?, level : Severity level, level=(severity : Severity) : Severity level=, silent? : Bool silent?, warn(agent : Agent, message : String) : Nil
warn(agent : Agent, &block : -> String) : Nil warn, warn? : Bool warn?
Instance methods inherited from module Earl::Agent
  
  
    
      call
    call, 
    
  
    
      crashed? : Bool
    crashed?, 
    
  
    
      recycle : Nil
    recycle, 
    
  
    
      recycling? : Bool
    recycling?, 
    
  
    
      reset : Nil
    reset, 
    
  
    
      running? : Bool
    running?, 
    
  
    
      spawn(*, link : Agent | Nil = nil, _yield = true) : Nil
    spawn, 
    
  
    
      start(*, link : Agent | Nil = nil) : Nil
    start, 
    
  
    
      starting? : Bool
    starting?, 
    
  
    
      stop : Nil
    stop, 
    
  
    
      stopped? : Bool
    stopped?, 
    
  
    
      stopping? : Bool
    stopping?, 
    
  
    
      terminate : Nil
    terminate, 
    
  
    
      trap(agent : Agent, exception : Exception | Nil) : Nil
    trap
    
  
    
    
  
    
    
    
  
    
    
    
  
Constructor Detail
Instance Method Detail
        
        def call
        #
      
      
        Spawns all agents to supervise in their dedicated Fiber. Blocks until
all agents have stopped.
Recycles and restarts crashed agents. Take note that an agent has stopped.