Eventfd class
- add conf.gem line to
build_config.rb
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
e = Eventfd.new 0, 0
p e.fd
pid = Process.fork() do
p "child fork... sleep 5"
sleep 5
e.event_write 999
end
p "event read..."
e.event_read do |ret|
p ret
p e.close
end
$ ./bin/mruby test.rb
4
"event read..."
"child fork... sleep 5"
999
0
under the MIT License:
- see LICENSE file