Class: Libuv::FSEvent

Inherits:
Handle show all
Defined in:
lib/libuv/fs_event.rb

Constant Summary collapse

EVENTS =
{1 => :rename, 2 => :change}.freeze

Constants included from Assertions

Assertions::MSG_NO_PROC

Constants inherited from Q::Promise

Q::Promise::MAKE_PROMISE

Instance Attribute Summary

Attributes inherited from Handle

#closed, #reactor, #storage

Attributes inherited from Q::Promise

#trace

Instance Method Summary collapse

Methods inherited from Handle

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

Methods included from Assertions

#assert_block, #assert_boolean, #assert_type

Methods included from Resource

#check_result, #check_result!, #resolve, #to_ptr

Methods inherited from Q::DeferredPromise

#resolved?, #then

Methods inherited from Q::Promise

#catch, #finally, #progress, #ruby_catch, #value

Constructor Details

#initialize(reactor, path) ⇒ FSEvent

Returns a new instance of FSEvent.



13
14
15
16
17
18
19
20
# File 'lib/libuv/fs_event.rb', line 13

def initialize(reactor, path)
    @reactor = reactor

    fs_event_ptr = ::Libuv::Ext.allocate_handle_fs_event
    error = check_result ::Libuv::Ext.fs_event_init(reactor.handle, fs_event_ptr, path, callback(:on_fs_event, fs_event_ptr.address), 0)

    super(fs_event_ptr, error)
end