ClusterRouterOptionsType
Esta página aún no está disponible en tu idioma.
ClusterRouterOptionsType<
TMessage> =object
Defined in: src/cluster/router/ClusterRouterOptions.ts:7
Plain options-object shape consumed by ClusterRouter.factory.
Type Parameters
Section titled “Type Parameters”TMessage
Section titled “TMessage”TMessage
Properties
Section titled “Properties”cluster
Section titled “cluster”
readonlycluster:Cluster
Defined in: src/cluster/router/ClusterRouterOptions.ts:9
The cluster the router lives in. Used for membership + transport.
extractKey?
Section titled “extractKey?”
readonlyoptionalextractKey?: (message) =>string
Defined in: src/cluster/router/ClusterRouterOptions.ts:27
Required for routerType: 'consistent-hashing', ignored otherwise.
Returns the string key used to pin a message to a routee. Two
messages with the same key always land on the same node (subject
to the cluster topology not changing).
Parameters
Section titled “Parameters”message
Section titled “message”TMessage
Returns
Section titled “Returns”string
mailboxDepthRefreshMs?
Section titled “mailboxDepthRefreshMs?”
readonlyoptionalmailboxDepthRefreshMs?:number
Defined in: src/cluster/router/ClusterRouterOptions.ts:39
How often, in milliseconds, the router refreshes its cached view of every
routee node’s mailbox depth. Read only for
routerType: 'smallest-mailbox'; ignored otherwise.
This is the lag on the router’s picture of the cluster, and the rate at which it costs one small envelope per routee. Shorter tracks a fast-moving load more closely and talks more; longer is cheaper and routes on an older view. Defaults to DEFAULT_MAILBOX_DEPTH_REFRESH_MS.
mailboxDepthStaleAfterMs?
Section titled “mailboxDepthStaleAfterMs?”
readonlyoptionalmailboxDepthStaleAfterMs?:number
Defined in: src/cluster/router/ClusterRouterOptions.ts:50
How long, in milliseconds, a cached depth stays usable. A routee whose last reading is older is skipped as though it had never answered, so the router routes on silence the way it would on a cold cache — round-robin order — instead of on a number from before a node went quiet.
0 turns the expiry off: a reading is then used however old it is.
Read only for routerType: 'smallest-mailbox'. Defaults to
DEFAULT_MAILBOX_DEPTH_STALE_AFTER_MS.
readonlyoptionalrole?:string
Defined in: src/cluster/router/ClusterRouterOptions.ts:11
Restrict routees to up-members carrying this role. Omit for “any node”.
routeePath
Section titled “routeePath”
readonlyrouteePath:string
Defined in: src/cluster/router/ClusterRouterOptions.ts:20
The path the routee actor lives under on each routee node — usually
/user/<actorName>. The same path must exist on every targeted
node; the router doesn’t probe for liveness beyond the cluster
membership state.
routerType
Section titled “routerType”
readonlyrouterType:ClusterRouterType
Defined in: src/cluster/router/ClusterRouterOptions.ts:13
Strategy. See ClusterRouterType.
