https://github.com/pyama86/mruby-signal-thread
Multi-threaded signal handler
https://github.com/pyama86/mruby-signal-thread
mruby
Last synced: 6 months ago
JSON representation
Multi-threaded signal handler
- Host: GitHub
- URL: https://github.com/pyama86/mruby-signal-thread
- Owner: pyama86
- License: other
- Created: 2017-03-05T14:43:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-06T16:09:10.000Z (over 5 years ago)
- Last Synced: 2025-04-16T03:53:40.003Z (9 months ago)
- Topics: mruby
- Language: C
- Size: 37.1 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mruby-signal-thread [](https://travis-ci.org/pyama86/mruby-signal-thread)
SignalThread class
## install by mrbgems
- add conf.gem line to `build_config.rb`
```ruby
MRuby::Build.new do |conf|
# ... (snip) ...
conf.gem :github => 'pyama86/mruby-signal-thread'
end
```
## example
```ruby
SignalThread.trap(:HUP) do
puts "foo"
end
puts "wait..."
loop { sleep 1 }
```
```bash
$ mruby/bin/mruby example/signal_thread.rb &
wait...
$ kill -HUP $(pidof mruby)
foo
```
## License
under the MIT License:
- see LICENSE file