Interface IInstanceRegistry
Namespace: DotBoxD.Services.Server
Assembly: DotBoxD.Services.dll
Per-connection registry that holds server-side sub-service instances by opaque instance identifier. Created by the server when a connection is accepted and drained when the connection closes — instances therefore have connection-scoped lifetime and cannot leak across tenants.
public interface IInstanceRegistryMethods
Section titled “Methods”Register(string, object)
Section titled “ Register(string, object)”Registers an instance under serviceName and returns the
freshly allocated identifier the client will quote on subsequent calls.
serviceName must be non-empty and non-whitespace.
string Register(string serviceName, object instance)Parameters
Section titled “Parameters”serviceName string
instance object
Returns
Section titled “Returns”Release(string, string)
Section titled “ Release(string, string)”Releases an instance early (the connection-teardown path also clears it). Keys must be non-empty and non-whitespace.
void Release(string serviceName, string instanceId)Parameters
Section titled “Parameters”serviceName string
instanceId string
ReleaseAll()
Section titled “ ReleaseAll()”Removes every entry — called from the connection-cleanup path.
void ReleaseAll()ReleaseAsync(string, string)
Section titled “ ReleaseAsync(string, string)”Releases an instance early, awaiting async disposal when the instance supports it. Keys must be non-empty and non-whitespace.
ValueTask ReleaseAsync(string serviceName, string instanceId)Parameters
Section titled “Parameters”serviceName string
instanceId string
Returns
Section titled “Returns”TryGet(string, string, out object)
Section titled “ TryGet(string, string, out object)”Looks up an instance previously registered under
(serviceName, instanceId). Invalid or unknown keys
return false.
bool TryGet(string serviceName, string instanceId, out object instance)Parameters
Section titled “Parameters”serviceName string
instanceId string
instance object