lib/uv/loop.rb in uvrb-0.1.4 vs lib/uv/loop.rb in uvrb-0.2.0
- old
+ new
@@ -103,10 +103,14 @@
# Returns nothing
def run_once
run(:UV_RUN_ONCE)
end
+ def stop
+ check_result! UV.stop(@pointer)
+ end
+
# Public: forces loop time update, useful for getting more granular times
#
# Returns nothing
def update_time
UV.update_time(@pointer)
@@ -276,9 +280,19 @@
fs_event_ptr = UV.create_handle(:uv_fs_event)
fs_event = FSEvent.new(self, fs_event_ptr, &block)
check_result! UV.fs_event_init(@pointer, fs_event_ptr, path, fs_event.callback(:on_fs_event), 0)
fs_event
+ end
+
+ # Public: Get a new Signal handle
+ #
+ # Returns UV::Signal
+ def signal
+ signal_ptr = UV.create_handle(:uv_signal)
+
+ check_result! UV.signal_init(@pointer, signal_ptr)
+ Signal.new(self, signal_ptr)
end
# Internal: Get a hold of internal loop pointer instance
#
# Returns FFI::Pointer