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
Constants inherited from Q::Promise
Instance Attribute Summary
Attributes inherited from Handle
Instance Method Summary collapse
-
#initialize(loop, callback = nil, &blk) ⇒ Idle
constructor
A new instance of Idle.
-
#progress(callback = nil, &blk) ⇒ 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, #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
Constructor Details
#initialize(loop, callback = nil, &blk) ⇒ Idle
Returns a new instance of Idle.
7 8 9 10 11 12 13 14 15 |
# File 'lib/libuv/idle.rb', line 7 def initialize(loop, callback = nil, &blk) @loop = loop @callback = callback || blk idle_ptr = ::Libuv::Ext.create_handle(:uv_idle) error = check_result(::Libuv::Ext.idle_init(loop.handle, idle_ptr)) super(idle_ptr, error) end |
Instance Method Details
#progress(callback = nil, &blk) ⇒ Object
Used to update the callback that will be triggered on idle
34 35 36 |
# File 'lib/libuv/idle.rb', line 34 def progress(callback = nil, &blk) @callback = callback || blk end |