Exemple #1
0
    def write_data(self, msg_producer):
        if self.transport.is_closing():
            return

        if self.transport is None:
            self._buffered_data.append(
                protocols.create_msgpack_message(msg_producer.msg2str()))
        else:
            self.transport.write(
                protocols.create_msgpack_message(msg_producer.msg2str()))
Exemple #2
0
    def process(self):
        conn_id = self.data[b'conn_id']

        if conn_id in TASKS:
            protocol = TASKS[conn_id]
            msg = protocols.CloseConnProducer(conn_id=conn_id)
            if protocol.transport and not protocol.transport.is_closing():
                protocol.transport.write(
                    protocols.create_msgpack_message(msg.msg2str()))
                protocol.transport.close()
            del TASKS[conn_id]
Exemple #3
0
 def write_data(self, msg_producer):
     self.transport.write(protocols.create_msgpack_message(msg_producer.msg2str()))