本文整理汇总了Python中thrift.Thrift.TMessageType.ONEWAY属性的典型用法代码示例。如果您正苦于以下问题:Python TMessageType.ONEWAY属性的具体用法?Python TMessageType.ONEWAY怎么用?Python TMessageType.ONEWAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类thrift.Thrift.TMessageType
的用法示例。
在下文中一共展示了TMessageType.ONEWAY属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def process(self, iprot, oprot):
(name, type, seqid) = iprot.readMessageBegin();
if type != TMessageType.CALL & type != TMessageType.ONEWAY:
raise TException("TMultiplex protocol only supports CALL & ONEWAY")
index = name.find(TMultiplexedProtocol.SEPARATOR)
if index < 0:
raise TException("Service name not found in message name: " + name + ". Did you forget to use TMultiplexProtocol in your client?")
serviceName = name[0:index]
call = name[index+len(TMultiplexedProtocol.SEPARATOR):]
if not serviceName in self.services:
raise TException("Service name not found: " + serviceName + ". Did you forget to call registerProcessor()?")
standardMessage = (
call,
type,
seqid
)
return self.services[serviceName].process(StoredMessageProtocol(iprot, standardMessage), oprot)
示例2: process
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def process(self, iprot, oprot):
(name, type, seqid) = iprot.readMessageBegin()
if type != TMessageType.CALL and type != TMessageType.ONEWAY:
raise TException("TMultiplex protocol only supports CALL & ONEWAY")
index = name.find(TMultiplexedProtocol.SEPARATOR)
if index < 0:
raise TException("Service name not found in message name: " + name + ". Did you forget to use TMultiplexProtocol in your client?")
serviceName = name[0:index]
call = name[index + len(TMultiplexedProtocol.SEPARATOR):]
if serviceName not in self.services:
raise TException("Service name not found: " + serviceName + ". Did you forget to call registerProcessor()?")
standardMessage = (call, type, seqid)
return self.services[serviceName].process(StoredMessageProtocol(iprot, standardMessage), oprot)
示例3: writeMessageBegin
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def writeMessageBegin(self, name, type, seqid):
if (type == TMessageType.CALL or
type == TMessageType.ONEWAY):
self.protocol.writeMessageBegin(
self.serviceName + SEPARATOR + name,
type,
seqid
)
else:
self.protocol.writeMessageBegin(name, type, seqid)
示例4: writeMessageBegin
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def writeMessageBegin(self, name, type, seqid):
if (type == TMessageType.CALL or
type == TMessageType.ONEWAY):
self.protocol.writeMessageBegin(
self.serviceName + SEPARATOR + name,
type,
seqid
)
else:
self.protocol.writeMessageBegin(name, type, seqid)
示例5: send_emitZipkinBatch
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def send_emitZipkinBatch(self, spans):
self._oprot.writeMessageBegin('emitZipkinBatch', TMessageType.ONEWAY, self._seqid)
args = emitZipkinBatch_args()
args.spans = spans
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
示例6: send_emitBatch
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def send_emitBatch(self, batch):
self._oprot.writeMessageBegin('emitBatch', TMessageType.ONEWAY, self._seqid)
args = emitBatch_args()
args.batch = batch
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
示例7: message_type_to_str
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def message_type_to_str(mtype):
if mtype == TMessageType.CALL:
return 'call'
elif mtype == TMessageType.REPLY:
return 'reply'
elif mtype == TMessageType.EXCEPTION:
return 'exception'
elif mtype == TMessageType.ONEWAY:
return 'oneway'
else:
raise ValueError('Unknown message type: %s' % mtype)
示例8: send_reinitialize
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def send_reinitialize(self):
self._oprot.writeMessageBegin('reinitialize', TMessageType.ONEWAY, self._seqid)
args = reinitialize_args()
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
示例9: send_shutdown
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def send_shutdown(self):
self._oprot.writeMessageBegin('shutdown', TMessageType.ONEWAY, self._seqid)
args = shutdown_args()
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
示例10: send_emitZipkinBatch
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def send_emitZipkinBatch(self, spans):
oprot = self._oprot_factory.getProtocol(self._transport)
oprot.writeMessageBegin('emitZipkinBatch', TMessageType.ONEWAY, self._seqid)
args = emitZipkinBatch_args()
args.spans = spans
args.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
示例11: send_emitBatch
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def send_emitBatch(self, batch):
oprot = self._oprot_factory.getProtocol(self._transport)
oprot.writeMessageBegin('emitBatch', TMessageType.ONEWAY, self._seqid)
args = emitBatch_args()
args.batch = batch
args.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
示例12: send_testOneway
# 需要导入模块: from thrift.Thrift import TMessageType [as 别名]
# 或者: from thrift.Thrift.TMessageType import ONEWAY [as 别名]
def send_testOneway(self, secondsToSleep):
self._oprot.writeMessageBegin('testOneway', TMessageType.ONEWAY, self._seqid)
args = testOneway_args()
args.secondsToSleep = secondsToSleep
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()