Home > @imqueue/core > ClusterManager > forEachCluster
ClusterManager.forEachCluster() method
Applies the given callback to every registered cluster. Each cluster is handled independently: a callback that throws (synchronously or asynchronously) for one cluster never prevents the remaining clusters from being processed.
Signature:
forEachCluster(fn: (cluster: InitializedCluster) => Promise<void> | void): Promise<void>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
fn |
(cluster: InitializedCluster) => Promise<void> | void |
callback to apply to each registered cluster |
Returns:
Promise<void>
Remarks
Callback failures are discarded: the returned promise always resolves and errors are neither rethrown nor logged, so callbacks must handle and report their own failures.