# ClusterManager.forEachCluster() method · @imqueue/core

Source: https://imqueue.org/api/core/latest/core.clustermanager.foreachcluster/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/core 3.3.2 — generated reference, not hand-written

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:**

```typescript
forEachCluster(fn: (cluster: InitializedCluster) => Promise<void> | void): Promise<void>;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| fn | (cluster: [InitializedCluster](https://imqueue.org/api/core/latest/core.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.

