Example #1
0
 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()
Example #2
0
 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)
Example #3
0
 async def stomp(self, accepted_version, host=None):
     response = stomp.dumps(stomp.ConnectedFrame())
     self.transport.write(response.encode("utf-8"))
Example #4
0
 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()
Example #5
0
 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)
Example #6
0
 async def send_auto(self, message_frame):
     response = stomp.dumps(message_frame)
     self.transport.write(response.encode('utf-8'))
Example #7
0
 def test_dump_error(self):
     with self.assertRaises(ValueError):
         stomp.dumps("invalid")