当前位置: 首页>>代码示例>>Python>>正文


Python TMessageType.ONEWAY属性代码示例

本文整理汇总了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) 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:22,代码来源:TMultiplexedProcessor.py

示例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) 
开发者ID:Aditmadzs,项目名称:Protect4,代码行数:18,代码来源:TMultiplexedProcessor.py

示例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) 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:12,代码来源:TMultiplexedProtocol.py

示例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) 
开发者ID:Aditmadzs,项目名称:Protect4,代码行数:12,代码来源:TMultiplexedProtocol.py

示例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() 
开发者ID:open-telemetry,项目名称:opentelemetry-python,代码行数:9,代码来源:Agent.py

示例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() 
开发者ID:open-telemetry,项目名称:opentelemetry-python,代码行数:9,代码来源:Agent.py

示例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) 
开发者ID:pinterest,项目名称:thrift-tools,代码行数:13,代码来源:thrift_message.py

示例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() 
开发者ID:cloudera,项目名称:impyla,代码行数:8,代码来源:FacebookService.py

示例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() 
开发者ID:cloudera,项目名称:impyla,代码行数:8,代码来源:FacebookService.py

示例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() 
开发者ID:jaegertracing,项目名称:jaeger-client-python,代码行数:10,代码来源:Agent.py

示例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() 
开发者ID:jaegertracing,项目名称:jaeger-client-python,代码行数:10,代码来源:Agent.py

示例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() 
开发者ID:uber,项目名称:tchannel-python,代码行数:9,代码来源:ThriftTest.py


注:本文中的thrift.Thrift.TMessageType.ONEWAY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。