Class: FDB::LazyFuture
Instance Method Summary
collapse
Methods inherited from Future
#block_until_ready, #callback_wrapper, #cancel, finalize, #on_ready, #ready?, wait_for_any
Constructor Details
#initialize(fpointer) ⇒ 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?(message)
message = message.to_sym
message == :__result__ or
message == :to_ptr or
value.respond_to? message
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
raise
end
end
@set = true
end
@value
end
|