Created
May 8, 2025 23:12
-
-
Save havenwood/3c23a82197aaeb2b85998b7e3c2452c4 to your computer and use it in GitHub Desktop.
Just a sleep-alarm based thingy for an IRC example
This file contains hidden or 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
signal = 'ALRM' | |
status = Signal.list.fetch(signal) + 2**7 | |
pid = fork do | |
trap signal do | |
warn 'Alarm!' | |
exit status | |
end | |
sleep | |
end | |
sleep 3.14 | |
Process.kill(signal, pid) | |
Process.wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment