INNER CODE UNIT · Python

add_channel_restriction

permitio/fastapi_websocket_pubsub · fastapi_websocket_pubsub/event_notifier.py:89

    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]:
        """
        Subscribe to a set of topics.
        Once a notification (i.e. publish) of a topic is received the provided callback function will be called (with topic and data)


        Args:
            subscriber_id (SubscriberID): A UUID identifying the subscriber
            topics (TopicList, ALL_TOPICS): A list of topic to subscribe to (Each topic is saved in a separate subscription)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…