Home > @imqueue/core > ClusterManager > remove
ClusterManager.remove() method
Unregisters a cluster from this manager.
Signature:
remove(cluster: string | InitializedCluster, destroy?: boolean): Promise<void>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
cluster |
string | InitializedCluster |
the cluster handle returned by ClusterManager.init(), or its |
|
destroy |
boolean |
(Optional) when true (the default), destroy the manager once no clusters remain; pass false to unregister without tearing it down |
Returns:
Promise<void>
Remarks
Unregistering the last cluster destroys the manager and releases its transport — for UDPClusterManager that means shutting down the shared broadcast worker. Calling this with an unknown id while no clusters remain also triggers that shutdown, which is why destroy() implementations must be idempotent.