Class: UV::Signal

Inherits:
Object
  • Object
show all
Includes:
Assertions, Handle
Defined in:
lib/uv/signal.rb

Instance Method Summary collapse

Methods included from Assertions

#assert_arity, #assert_block, #assert_boolean, #assert_signal, #assert_type

Methods included from Handle

#active?, close, #close, #closing?, #initialize, #ref, #unref

Methods included from Resource

#check_result, #check_result!, #to_ptr

Methods included from Listener

define_callback, undefine_callbacks

Instance Method Details

#start(signum, &block) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/uv/signal.rb', line 5

def start(signum, &block)
  assert_signal(signum)
  assert_block(block)
  assert_arity(1, block)

  @signal_block = block

  check_result! UV.signal_start(handle, callback(:on_signal), signum)

  self
end

#stopObject



17
18
19
20
21
# File 'lib/uv/signal.rb', line 17

def stop
  check_result! UV.signal_stop(handle)

  self
end