Class: DTAS::Sigevent
- Inherits:
-
SleepyPenguin::EventFD
- Object
- SleepyPenguin::EventFD
- DTAS::Sigevent
- Defined in:
- lib/dtas/sigevent/efd.rb,
lib/dtas/sigevent/pipe.rb,
lib/dtas/sigevent/fiddle_efd.rb
Overview
:nodoc:
Constant Summary collapse
- EventFD =
Fiddle::Function.new(DTAS.libc['eventfd'], [ Fiddle::TYPE_INT, Fiddle::TYPE_INT ], # initval, flags Fiddle::TYPE_INT)
- ONE =
-([ 1 ].pack('Q'))
Instance Attribute Summary collapse
-
#to_io ⇒ Object
readonly
:nodoc:.
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize ⇒ Sigevent
constructor
A new instance of Sigevent.
- #readable_iter {|_self, nil| ... } ⇒ Object
- #signal ⇒ Object
Constructor Details
#initialize ⇒ Sigevent
Returns a new instance of Sigevent.
10 11 12 13 |
# File 'lib/dtas/sigevent/pipe.rb', line 10 def initialize @to_io, @wr = IO.pipe @rbuf = ''.b end |
Instance Attribute Details
#to_io ⇒ Object (readonly)
:nodoc:
8 9 10 |
# File 'lib/dtas/sigevent/pipe.rb', line 8 def to_io @to_io end |
Class Method Details
.new ⇒ Object
9 10 11 |
# File 'lib/dtas/sigevent/efd.rb', line 9 def self.new super(0, :CLOEXEC) end |
Instance Method Details
#close ⇒ Object
27 28 29 30 |
# File 'lib/dtas/sigevent/pipe.rb', line 27 def close @to_io.close @wr.close end |
#readable_iter {|_self, nil| ... } ⇒ Object
17 18 19 20 21 |
# File 'lib/dtas/sigevent/efd.rb', line 17 def readable_iter value(true) yield self, nil # calls DTAS::Process.reaper :wait_readable end |
#signal ⇒ Object
13 14 15 |
# File 'lib/dtas/sigevent/efd.rb', line 13 def signal incr(1) end |