Class: Tarantool16::DumbDB::SchemaFuture

Inherits:
Object
  • Object
show all
Defined in:
lib/tarantool16/dumb_db.rb

Constant Summary collapse

UNDEF =
Object.new.freeze

Instance Method Summary collapse

Constructor Details

#initializeSchemaFuture

Returns a new instance of SchemaFuture.



97
98
99
# File 'lib/tarantool16/dumb_db.rb', line 97

def initialize
  @r = UNDEF
end

Instance Method Details

#set(r) ⇒ Object



114
115
116
# File 'lib/tarantool16/dumb_db.rb', line 114

def set(r)
  @r = r
end

#then(cb) ⇒ Object



100
101
102
103
104
105
# File 'lib/tarantool16/dumb_db.rb', line 100

def then(cb)
  unless @r.equal? UNDEF
    return cb.call(@r)
  end
  raise "DumbDB::ShemaFuture future is not real future :-("
end

#then_blkObject



107
108
109
110
111
112
# File 'lib/tarantool16/dumb_db.rb', line 107

def then_blk
  unless @r.equal? UNDEF
    return yield @r
  end
  raise "DumbDB::ShemaFuture future is not real future :-("
end