Class: Yahns::QueueQuitter
- Defined in:
- lib/yahns/queue_quitter.rb,
lib/yahns/queue_quitter_pipe.rb
Overview
Copyright © 2013-2016 all contributors <[email protected]> License: GPL-3.0+ (www.gnu.org/licenses/gpl-3.0.txt) frozen_string_literal: true
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.
8 9 10 11 |
# File 'lib/yahns/queue_quitter_pipe.rb', line 8 def initialize @reader, @to_io = IO.pipe @to_io.close_on_exec = true end |
Instance Attribute Details
#to_io ⇒ Object (readonly)
:nodoc:
7 8 9 |
# File 'lib/yahns/queue_quitter_pipe.rb', line 7 def to_io @to_io end |
Instance Method Details
#close ⇒ Object
21 22 23 24 |
# File 'lib/yahns/queue_quitter_pipe.rb', line 21 def close @reader.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
11 12 13 |
# File 'lib/yahns/queue_quitter.rb', line 11 def yahns_step Thread.current.exit end |