INNER CODE UNIT · Python
__init__
permitio/fastapi_websocket_pubsub · fastapi_websocket_pubsub/event_notifier.py:62
def __init__(self):
# Topics->subscribers->subscription mapping
self._topics: Dict[Topic, Dict[SubscriberId, List[Subscription]]] = {}
# Lock used to sync access to mapped subscriptions
# Initialized JIT to be sure to grab the right asyncio-loop
self._lock: asyncio.Lock = None
# List of events to call when client subscribed
self._on_subscribe_events = []
# List of events to call when client unsubscribed
self._on_unsubscribe_events = []
# List of restriction checks to perform on every action on the channel
self._channel_restrictions = []
def gen_subscriber_id(self):
return gen_uid()
def gen_subscription_id(self):
return gen_uid()