register¶
-
tenjint.service.
register
(obj, name=None)[source]¶ Register a new object with the service layer.
This function registers an object with the service layer. Once registered, the object can be obtained by other objects using the
tenjint.service.get()
function. If no name for the object is provided, the object can be retrieved by its class name.- Parameters
- Raises
ValueError – If the service layer has not been initialized.
ServiceRegisteredError – If a service with this name already exists.