/** * call-seq: * Rev::Watcher.disable -> Rev::Watcher * * Temporarily disable an event watcher which is attached to a loop. * This is useful if you wish to toggle event monitoring on and off. */ static VALUE Rev_Watcher_disable(VALUE self) { struct Rev_Watcher *watcher_data; Data_Get_Struct(self, struct Rev_Watcher, watcher_data); rb_iv_set( watcher_data->loop, "@active_watchers", INT2NUM(NUM2INT(rb_iv_get(watcher_data->loop, "@active_watchers")) - 1) ); return self; }