class Raft4r::RPC::RPCClientConn

Public Class Methods

new(h) click to toggle source
# File lib/raft4r/rpc_base.rb, line 67
def initialize h
        @h = h
end

Public Instance Methods

receive_data(data) click to toggle source
# File lib/raft4r/rpc_base.rb, line 70
def receive_data data
        resp = Marshal.load(data)
        req = @h.pending[resp.req_id]
        return unless req
        @h.pending.delete resp.req_id
        req[1].call req[0], resp if req[1]
end