tlc.core.object_registry
#
Module for managing and caching Object instances with URL-based access and serialization support.
Module Contents#
Classes#
Class |
Description |
---|---|
Maintains a list of currently existing 3LC objects, and provides functionality for deserializing objects from JSON strings. |
API#
- class tlc.core.object_registry.ObjectRegistry#
Maintains a list of currently existing 3LC objects, and provides functionality for deserializing objects from JSON strings.
- static drop_cache() None #
Probably just a temporary workaround until we resolve ObjectRegistry semantics.
- static add_object_at_url(obj: tlc.core.object.Object, url: tlc.core.url.Url) None #
Add the given object with the given URL
- static consider_indexing_callbacks(obj: tlc.core.object.Object, url: tlc.core.url.Url, event_type: tlc.core.object_registry._IndexerCallbackEventType) None #
Maybe notify interested indexers of new objects for indexing
Improve indexing performance by push notifications, if wanted. Normally set up when creating indexing singletons.
- static get_object_from_url(url: tlc.core.url.Url) tlc.core.object.Object | None #
Get or create object from URL synchronously
- static delete_object_from_url(url: tlc.core.url.Url) None #
Tries to delete an object from an URL synchronously
Tries to delete the Url using available adapters Always removes the object from the registry’s internal caches
- static delete_object_from_url_async(url: tlc.core.url.Url) concurrent.futures.Future #
Tries to delete an object from an URL asynchronously
Tries to delete the Url using available adapters This also removes the object from the registry’s internal caches
- static get_or_create_object_from_url(url: tlc.core.url.Url) tlc.core.object.Object #
Get or create object from URL synchronously
- Parameters:
url – The URL to read the object from. This URL must be absolute.
- Raises:
ValueError – If the URL is not absolute.
- static get_or_create_object_from_url_async(url: tlc.core.url.Url) concurrent.futures.Future #
Get or create object from URL asynchronously
- Parameters:
url – The URL to read the object from. This URL must be absolute.
- Raises:
ValueError – If the URL is not absolute.
- static write_object_to_url(obj: tlc.core.object.Object, url: tlc.core.url.Url) None #
Write an object to a URL synchronously
- static write_object_to_url_async(obj: tlc.core.object.Object, url: tlc.core.url.Url) concurrent.futures.Future #
Write an object to a URL asynchronously