Class: Libuv::Prepare
- Inherits:
-
Handle
- Object
- Q::Promise
- Q::DeferredPromise
- Handle
- Libuv::Prepare
- Defined in:
- lib/libuv/prepare.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) ⇒ Prepare
constructor
A new instance of Prepare.
-
#progress(callback = nil, &blk) ⇒ Object
Used to update the callback that will be triggered on loop prepare.
-
#start ⇒ Object
Enables the prepare handler.
-
#stop ⇒ Object
Disables the prepare 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) ⇒ Prepare
Returns a new instance of Prepare.
10 11 12 13 14 15 16 17 18 |
# File 'lib/libuv/prepare.rb', line 10 def initialize(loop, callback = nil, &blk) @loop = loop @callback = callback || blk prepare_ptr = ::Libuv::Ext.allocate_handle_prepare error = check_result(::Libuv::Ext.prepare_init(loop.handle, prepare_ptr)) super(prepare_ptr, error) end |
Instance Method Details
#progress(callback = nil, &blk) ⇒ Object
Used to update the callback that will be triggered on loop prepare
37 38 39 |
# File 'lib/libuv/prepare.rb', line 37 def progress(callback = nil, &blk) @callback = callback || blk end |