async def disconnect(self, receipt_id, **headers): self.event_loop.call_soon(self.observer.delete) recept_frame = stomp.ReceiptFrame(receipt_id) reply = stomp.dumps(recept_frame) self.transport.write(reply.encode('utf-8')) self.message_service_task.cancel() self.transport.close()
def test_dumps_okay(self): response = stomp.dumps(self.frame) expected_response = ( 'SUBSCRIBE\r\n', 'ack:client\r\n', 'destination:/queue/foo\r\n', '\r\n', '\r\n', '\x00', ) for line in expected_response: self.assertIn(line, response)
async def stomp(self, accepted_version, host=None): response = stomp.dumps(stomp.ConnectedFrame()) self.transport.write(response.encode("utf-8"))
def _close_connection(self, error_frame): response = stomp.dumps(error_frame) self.transport.write(response.encode("utf-8")) self.message_service_task.cancel() self.transport.close()
async def send_client(self, message_frame): response = stomp.dumps(message_frame) response = response.encode('utf-8') for i in range(3): self.transport.write(response) await asyncio.sleep(20)
async def send_auto(self, message_frame): response = stomp.dumps(message_frame) self.transport.write(response.encode('utf-8'))
def test_dump_error(self): with self.assertRaises(ValueError): stomp.dumps("invalid")