Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created May 8, 2025 23:12
Show Gist options
  • Save havenwood/3c23a82197aaeb2b85998b7e3c2452c4 to your computer and use it in GitHub Desktop.
Save havenwood/3c23a82197aaeb2b85998b7e3c2452c4 to your computer and use it in GitHub Desktop.
Just a sleep-alarm based thingy for an IRC example
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