Class: ZooKeeper::AsyncOp
- Inherits:
-
Object
- Object
- ZooKeeper::AsyncOp
- Defined in:
- lib/zkruby/protocol.rb
Overview
Returned by asynchronous calls
Direct Known Subclasses
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
Returns the value of attribute backtrace.
Instance Method Summary collapse
-
#errback(&block) {|the| ... } ⇒ Object
(also: #on_error)
Provide an error callback.
- #errback=(block) ⇒ Object
-
#value ⇒ Object
Wait for the async op to finish and returns its value will raise an exception if the operation itself fails and there is no error handler the callback raises a StandardError and there is no error handler the error handler raises StandardError.
Instance Attribute Details
#backtrace ⇒ Object
Returns the value of attribute backtrace.
142 143 144 |
# File 'lib/zkruby/protocol.rb', line 142 def backtrace @backtrace end |
Instance Method Details
#errback(&block) {|the| ... } ⇒ Object Also known as: on_error
Provide an error callback.
147 148 149 |
# File 'lib/zkruby/protocol.rb', line 147 def errback(&block) set_error_handler(block) end |
#errback=(block) ⇒ Object
152 153 154 |
# File 'lib/zkruby/protocol.rb', line 152 def errback=(block) set_error_handler(block) end |
#value ⇒ Object
Wait for the async op to finish and returns its value will raise an exception if
the operation itself fails and there is no error handler
the callback raises a StandardError and there is no error handler
the error handler raises StandardError
163 164 165 166 167 168 169 |
# File 'lib/zkruby/protocol.rb', line 163 def value(); wait_value() rescue ZooKeeper::Error => ex # Set the backtrace to the original caller, rather than the ZK event loop ex.set_backtrace(@backtrace) if @backtrace raise ex end |