pyphoenix.pubsub
Local PubSub implementation for PyPhoenix.
Functions
Get or create the global PubSub instance. |
Classes
|
Local publish-subscribe system for inter-process communication. |
|
Represents a subscription to a topic. |
- class pyphoenix.pubsub.Subscription(topic, callback, pubsub)[source]
Represents a subscription to a topic.
- class pyphoenix.pubsub.PubSub[source]
Local publish-subscribe system for inter-process communication.
This is a simplified, single-node implementation that will later be extended for distributed operation.
- async subscribe(topic, callback)[source]
Subscribe to a topic.
- Parameters:
- Return type:
- Returns:
Subscription object that can be used to unsubscribe
- async direct_publish(node_id, topic, message)[source]
Publish directly to a specific node.
For now, this is the same as regular publish since we only have one node. This method is a placeholder for future distributed functionality.