Class: Libevent::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/libevent/base.rb,
ext/libevent_ext/base.c

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Create new event base


4
5
6
# File 'lib/libevent/base.rb', line 4

def initialize
  @signals = []
end

Instance Attribute Details

#signalsObject (readonly)

Returns the value of attribute signals


8
9
10
# File 'lib/libevent/base.rb', line 8

def signals
  @signals
end

Instance Method Details

#break_loopObject


11
# File 'ext/libevent_ext/base.c', line 11

static VALUE t_break_loop(VALUE self);

#dispatchObject


7
# File 'ext/libevent_ext/base.c', line 7

static VALUE t_dispatch(VALUE self);

#exit_loopObject


9
# File 'ext/libevent_ext/base.c', line 9

static VALUE t_exit_loop(VALUE self);

#trap_signal(name, &block) ⇒ Object

Create new signal with handler as block and add signal to event base

Parameters:

  • name (String)

    of signal


13
14
15
# File 'lib/libevent/base.rb', line 13

def trap_signal(name, &block)
  @signals << Signal.new(self, name, block)
end