Python thrift.Thrift.TMessageType.ONEWAY Examples

The following are 16 code examples of thrift.Thrift.TMessageType.ONEWAY(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module thrift.Thrift.TMessageType , or try the search function .
Example #1
Source File: TMultiplexedProcessor.py    From galaxy-sdk-python with Apache License 2.0 6 votes vote down vote up
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) 
Example #2
Source File: TMultiplexedProcessor.py    From Protect4 with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #3
Source File: TMultiplexedProcessor.py    From Aditmadzs2 with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #4
Source File: TMultiplexedProcessor.py    From ajs2 with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #5
Source File: TMultiplexedProtocol.py    From galaxy-sdk-python with Apache License 2.0 5 votes vote down vote up
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) 
Example #6
Source File: TMultiplexedProtocol.py    From Protect4 with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #7
Source File: TMultiplexedProtocol.py    From Aditmadzs2 with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #8
Source File: TMultiplexedProtocol.py    From ajs2 with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #9
Source File: Agent.py    From opentelemetry-python with Apache License 2.0 5 votes vote down vote up
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() 
Example #10
Source File: Agent.py    From opentelemetry-python with Apache License 2.0 5 votes vote down vote up
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() 
Example #11
Source File: thrift_message.py    From thrift-tools with Apache License 2.0 5 votes vote down vote up
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) 
Example #12
Source File: FacebookService.py    From impyla with Apache License 2.0 5 votes vote down vote up
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() 
Example #13
Source File: FacebookService.py    From impyla with Apache License 2.0 5 votes vote down vote up
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() 
Example #14
Source File: Agent.py    From jaeger-client-python with Apache License 2.0 5 votes vote down vote up
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() 
Example #15
Source File: Agent.py    From jaeger-client-python with Apache License 2.0 5 votes vote down vote up
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() 
Example #16
Source File: ThriftTest.py    From tchannel-python with MIT License 5 votes vote down vote up
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()