Class: DTAS::Sigevent

Inherits:
SleepyPenguin::EventFD
  • Object
show all
Includes:
SleepyPenguin
Defined in:
lib/dtas/sigevent/efd.rb,
lib/dtas/sigevent/pipe.rb

Overview

Copyright © 2013-2014, Eric Wong <[email protected]> and all contributors License: GPLv3 or later (www.gnu.org/licenses/gpl-3.0.txt)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSigevent

Returns a new instance of Sigevent.



6
7
8
# File 'lib/dtas/sigevent/pipe.rb', line 6

def initialize
  @to_io, @wr = IO.pipe
end

Instance Attribute Details

#to_ioObject (readonly)

:nodoc:



4
5
6
# File 'lib/dtas/sigevent/pipe.rb', line 4

def to_io
  @to_io
end

Class Method Details

.newObject



6
7
8
# File 'lib/dtas/sigevent/efd.rb', line 6

def self.new
  super(0, EventFD::CLOEXEC)
end

Instance Method Details

#closeObject



23
24
25
26
# File 'lib/dtas/sigevent/pipe.rb', line 23

def close
  @to_io.close
  @wr.close
end

#readable_iter {|_self, nil| ... } ⇒ Object

Yields:

  • (_self, nil)

Yield Parameters:



14
15
16
17
18
# File 'lib/dtas/sigevent/efd.rb', line 14

def readable_iter
  value(true)
  yield self, nil # calls DTAS::Process.reaper
  :wait_readable
end

#signalObject



10
11
12
# File 'lib/dtas/sigevent/efd.rb', line 10

def signal
  incr(1)
end