Class: Yahns::Sigevent
- Inherits:
-
SleepyPenguin::EventFD
- Object
- SleepyPenguin::EventFD
- Yahns::Sigevent
- Includes:
- Kgio::DefaultWaiters
- Defined in:
- lib/yahns/sigevent_efd.rb,
lib/yahns/sigevent_pipe.rb
Overview
Copyright © 2013, Eric Wong <[email protected]> and all contributors License: GPLv3 or later (www.gnu.org/licenses/gpl-3.0.txt)
Direct Known Subclasses
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.
- #kgio_wait_readable ⇒ Object
- #sev_signal ⇒ Object
- #yahns_step ⇒ Object
Constructor Details
#initialize ⇒ Sigevent
Returns a new instance of Sigevent.
6 7 8 9 |
# File 'lib/yahns/sigevent_pipe.rb', line 6 def initialize @to_io, @wr = Kgio::Pipe.new @to_io.close_on_exec = @wr.close_on_exec = true end |
Instance Attribute Details
#to_io ⇒ Object (readonly)
:nodoc:
5 6 7 |
# File 'lib/yahns/sigevent_pipe.rb', line 5 def to_io @to_io end |
Class Method Details
.new ⇒ Object
6 7 8 |
# File 'lib/yahns/sigevent_efd.rb', line 6 def self.new super(0, SleepyPenguin::EventFD::CLOEXEC) end |
Instance Method Details
#close ⇒ Object
26 27 28 29 |
# File 'lib/yahns/sigevent_pipe.rb', line 26 def close @to_io.close @wr.close end |
#kgio_wait_readable ⇒ Object
11 12 13 |
# File 'lib/yahns/sigevent_pipe.rb', line 11 def kgio_wait_readable @to_io.kgio_wait_readable end |
#sev_signal ⇒ Object
10 11 12 |
# File 'lib/yahns/sigevent_efd.rb', line 10 def sev_signal incr(1) # eventfd_write end |
#yahns_step ⇒ Object
14 15 16 17 |
# File 'lib/yahns/sigevent_efd.rb', line 14 def yahns_step value(true) # eventfd_read, we ignore this data :wait_readable end |