new CachingActorsRegistry(registry, maxCached, ttl)
Create new caching registry.
Parameters:
Name | Type | Description |
---|---|---|
registry |
module:x2node-ws.ActorsRegistry | The registry to wrap. |
maxCached |
number | Maximum number of cached actors. |
ttl |
number | Milliseconds after which a cached actor is expired. |
- Implements:
Methods
-
invalidateCachedActor(handle)
-
Invalidate cache entry for the actor specified by handler, if cached.
Parameters:
Name Type Description handle
string Actor handle. -
lookupActor(handle [, creds])
-
Parameters:
Name Type Argument Description handle
string Actor handle from the authenticator. creds
string <optional>
Registry-specific actor credentials, if any. - Implements:
Returns:
Actor record or a promise of it. Returningnull
or a promise that resolves to anull
means the actor does not exist for the handle. Ifcreds
is provided, may also mean that the credentials are invalid. If a promise is returned and the promise is rejected, it indicates an unexpected internal error.- Type
- module:x2node-common.Actor | Promise.<module:x2node-common.Actor>