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 handlestring Actor handle. -
lookupActor(handle [, creds])
-
Parameters:
Name Type Argument Description handlestring Actor handle from the authenticator. credsstring <optional>
Registry-specific actor credentials, if any. - Implements:
Returns:
Actor record or a promise of it. Returningnullor a promise that resolves to anullmeans the actor does not exist for the handle. Ifcredsis 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>