Class: Tarantool::EMDB::OneReplica

Inherits:
Object
  • Object
show all
Includes:
ParseIProto
Defined in:
lib/tarantool/em_db.rb

Constant Summary

Constants included from Util::Packer

Util::Packer::INT16, Util::Packer::INT32, Util::Packer::INT64, Util::Packer::INT8, Util::Packer::MAX_INT16, Util::Packer::MAX_INT32, Util::Packer::MAX_INT64, Util::Packer::MAX_INT8, Util::Packer::MAX_SINT16, Util::Packer::MAX_SINT32, Util::Packer::MAX_SINT64, Util::Packer::MAX_SINT8, Util::Packer::MIN_INT, Util::Packer::MIN_SINT16, Util::Packer::MIN_SINT32, Util::Packer::MIN_SINT64, Util::Packer::MIN_SINT8, Util::Packer::SINT16, Util::Packer::SINT32, Util::Packer::SINT64, Util::Packer::SINT8

Instance Method Summary collapse

Methods included from ParseIProto

#_parse_iproto

Constructor Details

#initialize(response, feed) ⇒ OneReplica

Returns a new instance of OneReplica.



78
79
80
81
# File 'lib/tarantool/em_db.rb', line 78

def initialize(response, feed)
  @response = response
  @feed = feed
end

Instance Method Details

#call(result) ⇒ Object



83
84
85
86
87
88
89
# File 'lib/tarantool/em_db.rb', line 83

def call(result)
  if Exception === (result = _parse_iproto(result))
    @feed.call result
  else
    @feed.call @response.parse_response_for_cb(result)
  end
end