registry
Registry module for storing volatile objects
Attributes
Classes
Registry
Bases: Generic[T]
A simple key/value registry for storing volatile objects
This class is thread-safe and should be ok to use via the API as long as it is wrapped with eleanor.backend.api.run_async
Functions
__contains__
Check if a key is present in the registry.
Parameters:
-
key
(str
) –The key to check.
Returns:
-
bool
(bool
) –True if the key is present, False otherwise.
__getitem__
__getitem__(key: str) -> T
Retrieve the value associated with the given key.
Parameters:
-
key
(str
) –The key to retrieve the value for.
Returns:
-
T
(T
) –The value associated with the key.
__setitem__
__setitem__(key: str, value: T) -> None
Set the value associated with the given key in the registry.
Parameters:
-
key
(str
) –The key to set the value for.
-
value
(T
) –The value to be set.
Returns:
-
None
–None
get
get(key: str) -> T
Retrieve the value associated with the given key from the registry.
Parameters:
-
key
(str
) –The key to retrieve the value for.
Returns:
-
T
(T
) –The value associated with the given key.
Raises:
-
KeyError
–If the key is not found in the registry.
remove
Remove the specified key from the registry.
Parameters:
-
key
(str
) –The key to be removed.
Returns:
-
None
–None