Class: FDB::LazyFuture
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(fpointer) ⇒ LazyFuture
constructor
A new instance of LazyFuture.
- #method_missing(*args, &block) ⇒ Object
- #respond_to?(message) ⇒ Boolean
- #value ⇒ Object
Methods inherited from Future
#block_until_ready, #callback_wrapper, #cancel, finalize, #on_ready, #ready?, wait_for_any
Constructor Details
#initialize(fpointer) ⇒ LazyFuture
Returns a new instance of LazyFuture.
423 424 425 426 427 |
# File 'lib/fdbimpl.rb', line 423 def initialize(fpointer) super(fpointer) @set = false @value = nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
419 420 421 |
# File 'lib/fdbimpl.rb', line 419 def method_missing( *args, &block ) value.__send__( *args, &block ) end |
Instance Method Details
#respond_to?(message) ⇒ Boolean
412 413 414 415 416 417 |
# File 'lib/fdbimpl.rb', line 412 def respond_to?() = .to_sym == :__result__ or == :to_ptr or value.respond_to? end |
#value ⇒ Object
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 |
# File 'lib/fdbimpl.rb', line 429 def value if !@set block_until_ready begin getter release_memory rescue Error => e if e.code != 1102 # future_released raise end end @set = true end @value end |