A ServiceReloader is a "registry" of services, allowing services to be reloaded dynamically. You can create a reloadable version of your service by using the reloadable operator on ZLayer. Then just call ServiceLoader.reload to reload the service.
Registers the specified service with a layer that constructs the service. Returns an implementation of the service that is backed by a ScopedRef which will handle reloading the service. Fails with a ServiceInitializationError exception if an error occurs while acquiring the service.
Registers the specified service with a layer that constructs the service. Returns an implementation of the service that is backed by a ScopedRef which will handle reloading the service. Fails with a ServiceInitializationError exception if an error occurs while acquiring the service.
Reloads the specified service, releasing any resources associated with the service and acquiring a new service. Fails with a ServiceInitializationError exception if an error occurs reloading the service or a ServiceNotRegistered exception if a layer constructing the service was never registered.
Reloads the specified service, releasing any resources associated with the service and acquiring a new service. Fails with a ServiceInitializationError exception if an error occurs reloading the service or a ServiceNotRegistered exception if a layer constructing the service was never registered.