def datagramReceived(self, datagram, address):
"""
Receive response from Paxos Learners, match the response with the original
request and pass it to the application handler.
"""
try:
fmt = '>' + 'B {0}s'.format(VALUE_SIZE)
packer = struct.Struct(fmt)
packed_size = struct.calcsize(fmt)
unpacked_data = packer.unpack(datagram[:packed_size])
req_id, result = unpacked_data
self.defers[req_id].callback(result)
pass
except defer.AlreadyCalledError as ex:
#logging.error("already call")
pass
评论列表
文章目录