m2r
m2r copied to clipboard
Handle signals
For:
- graceful stop
- force stop
- adding a thread
- removing a thread
- reloading configuration (if possible...)
Signal handling should be defined in our m2r binary instead of in the handler itself (as it is currently in rack-adapter branch).
What do you mean by m2r binary?
bin/m2r in the future.
I think that signal handling should be easy to turn off in case someone wants to use our library in another libary or tests or something and handle them suitable to his/her needs.
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/4039
I am not sure which part of this information is still true but we should be aware of the fact that #trap overwrites previous trap calls for particular signals. And that it is called in main thread (probably). That might be important when we become multithreading software.
http://blog.rubybestpractices.com/posts/ewong/016-Implementing-Signal-Handlers.html
http://blog.headius.com/2008/02/ruby-threadraise-threadkill-timeoutrb.html http://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html