示例#1
0
文件: client.py 项目: grkvlt/amqp
 def send(self, message=None, delivery_tag=None, txn=None, **kwargs):
   self.wait(self.capacity)
   if message:
     kwargs["message_format"] = 0
     kwargs["payload"] = encode(message)
     if delivery_tag is None:
       delivery_tag = message.delivery_tag
   if txn is not None:
     kwargs["state"] = TransactionalState(Binary(txn))
   return self.proto.send(delivery_tag=delivery_tag, **kwargs)
示例#2
0
文件: hole.py 项目: rhs/amqp
 def get(self):
     return str(self.hole.identify()), Transfer(fragments=encode(Message()))