Class: Couchbase::EM::Socket

Inherits:
Connection
  • Object
show all
Defined in:
ext/couchbase_ext/eventmachine_plugin.c

Instance Method Summary collapse

Instance Method Details

#notify_readableObject



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'ext/couchbase_ext/eventmachine_plugin.c', line 135

static VALUE
rb_em_socket_notify_readable(VALUE self)
{
    VALUE event = rb_ivar_get(self, cb_id_iv_event);
    rb_em_event *ev;

    if (RTEST(event)) {
        Data_Get_Struct(event, rb_em_event, ev);
        rb_em_event_run_callback(ev, LCB_READ_EVENT);
    } else {
        rb_funcall_0(self, cb_id_detach);
    }

    return Qnil;
}

#notify_writableObject



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'ext/couchbase_ext/eventmachine_plugin.c', line 151

static VALUE
rb_em_socket_notify_writable(VALUE self)
{
    VALUE event = rb_ivar_get(self, cb_id_iv_event);
    rb_em_event *ev;

    if (RTEST(event)) {
        Data_Get_Struct(event, rb_em_event, ev);
        rb_em_event_run_callback(ev, LCB_WRITE_EVENT);
    } else {
        rb_funcall_0(self, cb_id_detach);
    }

    return Qnil;
}