abstract const classstuds::Daemon
sys::Obj studs::Daemon
Daemon provides an API for long-running system services running on their own thread with life-cycle callbacks for start, stop, poll, and custom messages.
See Daemons chapter for details.
- log
const Log log
Log for this daemon.
- make
new make(Duration? pollFreq)
Subclass constructor where
pollFreq
is the frequency to invoke onPoll callback, ornull
to not schedule a poll callback.- name
Str name()
Programmtic name of this daemon, which by convention is simply the type name lowercased.
- onMsg
protected virtual Obj? onMsg(DaemonMsg m)
Callback to process a daemon message.
- onPoll
protected virtual Void onPoll()
Callback when periodic poll is dispatched.
- onStart
protected virtual Void onStart()
Callback when daemon is started.
- onStop
protected virtual Void onStop()
Callback when daemon is stopped.
- send
Send this daemon a message.
- start
This start()