Skip to content

copySubscriptions

copySubscriptions(fromChannelName, toChannelName): number[]

Defined in: index.cts:513

DEPRECATED: Use subscribe(fromChannelName, toChannelName) instead.

Copies all subscribers from one channel to another channel. Uses reference counting - if a subscriber is already subscribed to the destination channel, their reference count will be incremented instead of creating duplicate subscriptions.

string | ArrayBuffer | Uint8Array<ArrayBufferLike>

The source channel name (Buffer, ArrayBuffer, or string).

string | ArrayBuffer | Uint8Array<ArrayBufferLike>

The destination channel name (Buffer, ArrayBuffer, or string).

number[]

An array of socket IDs that were newly added to the destination channel. Sockets that were already subscribed (and had their reference count incremented) are not included.