fiftyone.operators.store.subscription_registry#
Subscription registry class.
Classes:
Abstract base class for subscription registry. |
|
- class fiftyone.operators.store.subscription_registry.LocalSubscriptionRegistry#
Bases:
ABCAbstract base class for subscription registry.
Methods:
subscribe(store_name, callback[, dataset_id])Registers a subscription for a given store.
unsubscribe(subscription_id)Unsubscribes a subscription by its id.
unsubscribe_all(store_name)Unsubscribes all subscriptions for a given store.
Empties all subscribers.
get_subscribers(store_name)Retrieves all subscriptions for a given store.
- abstract subscribe(store_name: str, callback: Callable[[str], None], dataset_id: str | None = None) str#
Registers a subscription for a given store. Returns a unique subscription id.
- Parameters:
store_name – The name of the store to subscribe to.
callback – The callback to call when a change occurs.
dataset_id – Optional dataset ID to filter changes by.
- abstract unsubscribe(subscription_id: str) bool#
Unsubscribes a subscription by its id. Returns True if a subscription was removed.
- abstract unsubscribe_all(store_name: str)#
Unsubscribes all subscriptions for a given store.
- abstract empty_subscribers() None#
Empties all subscribers.
- abstract get_subscribers(store_name: str) Dict[str, Tuple[Callable[[str], None], str | None]]#
Retrieves all subscriptions for a given store. Returns a dictionary mapping subscription id to a tuple of (callback, dataset_id).
- class fiftyone.operators.store.subscription_registry.InLocalMemorySubscriptionRegistry#
Bases:
LocalSubscriptionRegistryMethods:
subscribe(store_name, callback[, dataset_id])Registers a subscription for a given store.
unsubscribe(subscription_id)Unsubscribes a subscription by its id.
unsubscribe_all(store_name)Unsubscribes all subscriptions for a given store.
get_subscribers(store_name)Retrieves all subscriptions for a given store.
Empties all subscribers.
- subscribe(store_name: str, callback: Callable[[str], None], dataset_id: str | None = None) str#
Registers a subscription for a given store. Returns a unique subscription id.
- Parameters:
store_name – The name of the store to subscribe to.
callback – The callback to call when a change occurs.
dataset_id – Optional dataset ID to filter changes by.
- unsubscribe(subscription_id: str) bool#
Unsubscribes a subscription by its id. Returns True if a subscription was removed.
- unsubscribe_all(store_name: str)#
Unsubscribes all subscriptions for a given store.
- get_subscribers(store_name: str) Dict[str, Tuple[Callable[[str], None], str | None]]#
Retrieves all subscriptions for a given store. Returns a dictionary mapping subscription id to a tuple of (callback, dataset_id).
- empty_subscribers() None#
Empties all subscribers.