The cluster events interface.

interface IClusterEvents {
    agent-join: ((payload: IAgentInfoEventPayload) => void);
    agent-leave: ((payload: INodeEventPayload) => void);
    agent-update: ((payload: IAgentInfoEventPayload) => void);
    cluster-disconnect: ((payload: INodeEventPayload) => void);
    cluster-leave: (() => void);
    content-publish-media: ((payload: IPublishMediaStreamEventPayload) => void);
    content-unpublish-media: ((payload: IUnpublishMediaStreamEventPayload) => void);
    local-media-stream-track-fail: ((payload: ILocalMediaStreamTrackFailEventPayload) => void);
    user-join: ((payload: IUserInfoEventPayload) => void);
    user-leave: ((payload: INodeEventPayload) => void);
    user-update: ((payload: IUserInfoEventPayload) => void);
}

Events

agent-join: ((payload: IAgentInfoEventPayload) => void)

agent-join - Event fired when an agent joins the cluster.

Type declaration

agent-leave: ((payload: INodeEventPayload) => void)

agent-leave - Event fired when an agent leaves the cluster.

Type declaration

    • (payload): void
    • Parameters

      Returns void

agent-update: ((payload: IAgentInfoEventPayload) => void)

agent-update - Event fired when an agent updates its information.

Type declaration

cluster-disconnect: ((payload: INodeEventPayload) => void)

cluster-disconnect - Event fired when the current node is disconnected from the cluster.

Type declaration

    • (payload): void
    • Parameters

      Returns void

cluster-leave: (() => void)

cluster-leave - Event fired when the current node leaves the cluster.

content-publish-media: ((payload: IPublishMediaStreamEventPayload) => void)

content-publish-media - Event fired when a node publishes a new media stream.

Type declaration

content-unpublish-media: ((payload: IUnpublishMediaStreamEventPayload) => void)

content-unpublish-media - Event fired when a node unpublishes a media stream.

Type declaration

local-media-stream-track-fail: ((payload: ILocalMediaStreamTrackFailEventPayload) => void)

local-media-stream-track-fail - Event fired when a local media stream track fails.

Type declaration

    • (payload): void
    • Parameters

      • payload: ILocalMediaStreamTrackFailEventPayload

        The local media stream track fail event payload.

        If the local media stream is a ILocalDynamicMediaStream, you can remove the failed track from the stream and add a new one to the stream. If the local media stream is a ILocalMediaStream, you will have to unpublish the stream and publish a new one with new tracks.

      Returns void

user-join: ((payload: IUserInfoEventPayload) => void)

user-join - Event fired when a user joins the cluster.

Type declaration

user-leave: ((payload: INodeEventPayload) => void)

user-leave - Event fired when a user leaves the cluster.

Type declaration

    • (payload): void
    • Parameters

      Returns void

user-update: ((payload: IUserInfoEventPayload) => void)

user-update - Event fired when a user updates its information.

Type declaration