Models
Consumers for the dasf-broker-django app.
Classes:
|
A consumer to handle pong messages of a topic. |
|
A consumer of messages. |
|
A producer of messages for a certain topic. |
- class dasf_broker.consumers.PongConsumer(*args, **kwargs)
Bases:
JsonWebsocketConsumerA consumer to handle pong messages of a topic.
Methods:
connect()receive_json(content, **kwargs)Called with decoded JSON content.
- connect()
- receive_json(content, **kwargs)
Called with decoded JSON content.
- class dasf_broker.consumers.TopicConsumer(*args, **kwargs)
Bases:
JsonWebsocketConsumerA consumer of messages.
Methods:
connect()dasf_api_info(event)Send a ping message to the topic.
dasf_message(event)dasf_ping(event)Send a ping message to the topic.
disconnect(close_code)Called when a WebSocket connection is closed.
receive_json(content, **kwargs)Called with decoded JSON content.
Attributes:
- connect()
- dasf_api_info(event)
Send a ping message to the topic.
- dasf_message(event)
- dasf_ping(event)
Send a ping message to the topic.
- property dasf_topic: BrokerTopic | None
- disconnect(close_code)
Called when a WebSocket connection is closed.
- receive_json(content, **kwargs)
Called with decoded JSON content.
- class dasf_broker.consumers.TopicProducer(*args, **kwargs)
Bases:
JsonWebsocketConsumerA producer of messages for a certain topic.
Methods:
connect()post_response_message(content)Hook to handle a message.
receive_json(content)Distibute the message to the consumers.
Attributes:
- connect()
- property dasf_topic: BrokerTopic | None
- post_response_message(content)
Hook to handle a message.
This method is supposed to be implemented by subclasses for a response message.