INNER CODE UNIT · Python
gen_subscription_id
permitio/fastapi_websocket_pubsub · fastapi_websocket_pubsub/event_notifier.py:78
def gen_subscription_id(self):
return gen_uid()
def _get_subscribers_lock(self):
"""
Init lock once - on current loop
"""
if self._lock is None:
self._lock = asyncio.Lock()
return self._lock
def add_channel_restriction(self, restriction_callback):
self._channel_restrictions.append(restriction_callback)
async def subscribe(
self,
subscriber_id: SubscriberId,
topics: Union[TopicList, ALL_TOPICS],