Skip to content

ridiculous/signals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Signals

Example of hot reloading a Ruby class from another process.

This application just calls Player.new.run in a loop, whose default behavior is to print out the current process ID. However, it also listens for the SIGUSR2 signal and will reload the Player class when it's received.

Start looping:

ruby runner.rb

Now edit the #run method in player.rb and save it. Afterwards, tell the original process to pick up the change:

kill -s SIGUSR2 <PID>

Try it out!

Just clone it and cd to the signals directory

git clone git@github.com:ridiculous/signals.git

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages