Class: Yahns::QueueQuitter
- Defined in:
- lib/yahns/queue_quitter.rb,
lib/yahns/queue_quitter_pipe.rb
Overview
Copyright © 2013, Eric Wong <[email protected]> and all contributors License: GPLv3 or later (www.gnu.org/licenses/gpl-3.0.txt)
POSIX pipe version, see queue_quitter.rb for the (preferred) eventfd one
Instance Attribute Summary collapse
-
#to_io ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
- #close ⇒ Object
- #fileno ⇒ Object
-
#initialize ⇒ QueueQuitter
constructor
A new instance of QueueQuitter.
- #yahns_step ⇒ Object
Methods inherited from Sigevent
#kgio_wait_readable, new, #sev_signal
Constructor Details
#initialize ⇒ QueueQuitter
Returns a new instance of QueueQuitter.
7 8 9 10 11 |
# File 'lib/yahns/queue_quitter_pipe.rb', line 7 def initialize reader, @to_io = IO.pipe @to_io.close_on_exec = true reader.close end |
Instance Attribute Details
#to_io ⇒ Object (readonly)
:nodoc:
6 7 8 |
# File 'lib/yahns/queue_quitter_pipe.rb', line 6 def to_io @to_io end |
Instance Method Details
#close ⇒ Object
21 22 23 |
# File 'lib/yahns/queue_quitter_pipe.rb', line 21 def close @to_io.close end |
#fileno ⇒ Object
17 18 19 |
# File 'lib/yahns/queue_quitter_pipe.rb', line 17 def fileno @to_io.fileno end |
#yahns_step ⇒ Object
10 11 12 |
# File 'lib/yahns/queue_quitter.rb', line 10 def yahns_step Thread.current.exit end |