stomp.adapter package¶
Submodules¶
stomp.adapter.multicast module¶
Multicast transport for stomp.py.
Obviously not a typical message broker, but convenient if you don’t have a broker, but still want to use stomp.py methods.
- class stomp.adapter.multicast.MulticastConnection(encoding='utf-8')¶
Bases:
BaseConnection
,Protocol12
- connect(username=None, passcode=None, wait=False, headers=None, **keyword_headers)¶
- Parameters:
username (str) –
passcode (str) –
wait (bool) –
headers (dict) –
keyword_headers –
- disconnect(receipt=None, headers=None, **keyword_headers)¶
- Parameters:
receipt (str) –
headers (dict) –
keyword_headers –
- send_frame(cmd, headers=None, body='')¶
- Parameters:
cmd (str) –
headers (dict) –
body –
- subscribe(destination, id, ack='auto', headers=None, **keyword_headers)¶
- Parameters:
destination (str) –
id (str) –
ack (str) –
headers (dict) –
keyword_headers –
- unsubscribe(id, headers=None, **keyword_headers)¶
- Parameters:
id (str) –
headers (dict) –
keyword_headers –
- class stomp.adapter.multicast.MulticastTransport(encoding)¶
Bases:
Transport
Transport over multicast connections rather than using a broker.
- attempt_connection()¶
Establish a multicast connection - uses 2 sockets (one for sending, the other for receiving)
- process_frame(f, frame_str)¶
- Parameters:
f (Frame) – Frame object
frame_str (bytes) – Raw frame content
- receive()¶
Receive 1024 bytes from the multicast receiver socket.
- Return type:
bytes
- send(encoded_frame)¶
Send an encoded frame through the mcast socket.
- Parameters:
encoded_frame (bytes) –
- stop()¶
Stop the connection. Performs a clean shutdown by waiting for the receiver thread to exit.
Module contents¶
Non-standard adapters.