Skip to content

Instantly share code, notes, and snippets.

@sargun
Created April 5, 2018 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sargun/4b7cf259d5393b24ccc16f7927a57f0f to your computer and use it in GitHub Desktop.
Save sargun/4b7cf259d5393b24ccc16f7927a57f0f to your computer and use it in GitHub Desktop.
use "signals"
actor Main
new create(env: Env) =>
// Create a TERM handler
let signal = SignalHandler(TermHandler(env), Sig.term())
// Raise TERM signal
signal.raise()
class TermHandler is SignalNotify
let _env: Env
new iso create(env: Env) =>
_env = env
fun ref apply(count: U32): Bool =>
_env.out.print("TERM signal received")
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment