Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/mruby-eventfd
Eventfd class
https://github.com/matsumotory/mruby-eventfd
Last synced: about 2 months ago
JSON representation
Eventfd class
- Host: GitHub
- URL: https://github.com/matsumotory/mruby-eventfd
- Owner: matsumotory
- License: other
- Created: 2015-05-19T06:00:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-12T10:04:14.000Z (almost 7 years ago)
- Last Synced: 2024-10-18T18:25:56.527Z (3 months ago)
- Language: C
- Homepage:
- Size: 4.88 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mruby-eventfd [![Build Status](https://travis-ci.org/matsumotory/mruby-eventfd.png?branch=master)](https://travis-ci.org/matsumotory/mruby-eventfd)
Eventfd class
## install by mrbgems
- add conf.gem line to `build_config.rb````ruby
MRuby::Build.new do |conf|# ... (snip) ...
conf.gem :github => 'matsumoto-r/mruby-eventfd'
# for below example
conf.gem :github => "iij/mruby-process"
conf.gem :github => "iij/mruby-io"
conf.gem :github => "iij/mruby-dir"end
```
## example
```ruby
e = Eventfd.new 0, 0p e.fd
pid = Process.fork() do
p "child fork... sleep 5"
sleep 5
e.event_write 999
endp "event read..."
e.event_read do |ret|
p ret
p e.close
end
```
## example run
```
$ ./bin/mruby test.rb
4
"event read..."
"child fork... sleep 5"
999
0
```## License
under the MIT License:
- see LICENSE file