INNER CODE UNIT · Python

_get_subscribers_lock

permitio/fastapi_websocket_pubsub · fastapi_websocket_pubsub/event_notifier.py:81

    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],
        callback: EventCallback,
        channel: Optional[RpcChannel] = None,
    ) -> List[Subscription]:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…