Class: FDB::FutureKeyValueArray
Instance Method Summary collapse
Methods inherited from Future
#block_until_ready, #callback_wrapper, #cancel, finalize, #initialize, #on_ready, #ready?, wait_for_any
Constructor Details
This class inherits a constructor from FDB::Future
Instance Method Details
#wait ⇒ Object
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
# File 'lib/fdbimpl.rb', line 465 def wait block_until_ready kvs = FFI::MemoryPointer.new :pointer count = FFI::MemoryPointer.new :int more = FFI::MemoryPointer.new :int FDBC.check_error FDBC.fdb_future_get_keyvalue_array(@fpointer, kvs, count, more) kvs = kvs.read_pointer [(0..count.read_int-1).map{|i| x = FDBC::KeyValueStruct.new(kvs + (i * FDBC::KeyValueStruct.size)) KeyValue.new(x[:key].read_bytes(x[:key_length]), x[:value].read_bytes(x[:value_length])) }, count.read_int, more.read_int] end |