INNER CODE UNIT · Python
Subscription
permitio/fastapi_websocket_pubsub · fastapi_websocket_pubsub/event_notifier.py:25
class Subscription(BaseModel):
"""
Data model to be stored per subscription, and sent to each subscriber via the callback
This allows for serializing the data down the line and sending to potential remote subscribers (via the callback),
in which case the callback field itself should be removed first.
"""
id: SubscriptionId
subscriber_id: SubscriberId
topic: Topic
callback: Callable = None
notifier_id: Optional[str] = None
# Publish event callback signature
def EventCallback(subscription: Subscription, data: Any):
pass