tlc.core.object_registry

Module for managing and caching Object instances with URL-based access and serialization support.

Module Contents

Classes

Class

Description

ObjectRegistry

Maintains a list of currently existing 3LC objects, and provides functionality for deserializing objects from JSON strings.

API

class 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: Object,
url: Url,
) None

Add the given object with the given URL

static consider_indexing_callbacks(
obj: Object,
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: Url,
) Object | None

Get or create object from URL synchronously

static delete_object_from_url(
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: Url,
) 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: Url,
) 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: Url,
) 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: Object,
url: Url,
) None

Write an object to a URL synchronously

static write_object_to_url_async(
obj: Object,
url: Url,
) Future

Write an object to a URL asynchronously