Class: Tarantool::EMDB::OneReplica

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

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