Class: Libuv::Idle
- Inherits:
-
Handle
- Object
- Q::Promise
- Q::DeferredPromise
- Handle
- Libuv::Idle
- Defined in:
- lib/libuv/idle.rb
Constant Summary
Constants included from Assertions
Instance Attribute Summary
Attributes inherited from Handle
Attributes inherited from Q::Promise
Instance Method Summary collapse
-
#initialize(reactor) ⇒ Idle
constructor
A new instance of Idle.
-
#progress(&callback) ⇒ Object
Used to update the callback that will be triggered on idle.
-
#start ⇒ Object
Enables the idle handler.
-
#stop ⇒ Object
Disables the idle handler.
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
Methods inherited from Q::Promise
#catch, #finally, #ruby_catch, #value
Constructor Details
#initialize(reactor) ⇒ Idle
Returns a new instance of Idle.
12 13 14 15 16 17 18 19 |
# File 'lib/libuv/idle.rb', line 12 def initialize(reactor) @reactor = reactor idle_ptr = ::Libuv::Ext.allocate_handle_idle error = check_result(::Libuv::Ext.idle_init(reactor.handle, idle_ptr)) super(idle_ptr, error) end |
Instance Method Details
#progress(&callback) ⇒ Object
Used to update the callback that will be triggered on idle
40 41 42 43 |
# File 'lib/libuv/idle.rb', line 40 def progress(&callback) @callback = callback self end |