Created
April 5, 2018 06:48
-
-
Save sargun/4b7cf259d5393b24ccc16f7927a57f0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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