Class: DTAS::Sigevent

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

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSigevent

Returns a new instance of Sigevent.



11
12
13
14
# File 'lib/dtas/sigevent/pipe.rb', line 11

def initialize
  @to_io, @wr = DTAS::Nonblock.pipe
  @rbuf = ''.b
end

Instance Attribute Details

#to_ioObject (readonly)

Returns the value of attribute to_io.



9
10
11
# File 'lib/dtas/sigevent/pipe.rb', line 9

def to_io
  @to_io
end

Class Method Details

.newObject

:nodoc:



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

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

Instance Method Details

#closeObject



28
29
30
31
# File 'lib/dtas/sigevent/pipe.rb', line 28

def close
  @to_io.close
  @wr.close
end

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

Yields:

  • (_self, nil)

Yield Parameters:



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

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

#signalObject



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

def signal
  incr(1)
end