class

Earl::Application

Inherits Earl::Supervisor < Earl::Logger < Earl::Agent < Reference < Object

A singleton Supervisor accessible as Earl.application with additional features suited for programs:

  • traps the SIGINT and SIGTERM signals to exit cleanly;
  • adds an at_exit handler to ask supervised agents to stop gracefully.

The Logger agent, among other possible agents, expect that Earl.application will be started. Programs must always start it. Either spawned in the background (and forgotten) or leveraged to monitor the program agents, and block the main Fiber until the program is told to terminate.

Instance methods

call

Traps signals. Adds an at_exit handler then delegates to Supervisor which will block until all supervised actors are asked to terminate.

signals

List of POSIX signals to trap. Defaults to SIGINT and SIGTERM. The list may only be changed prior to starting the application.