@valkey/valkey-glide
    Preparing search index...

    Interface ClusterPubSubState

    Represents the subscription state for a cluster client.

    This interface provides information about the current PubSub subscriptions for a cluster client. It includes both the desired subscriptions (what the client wants to maintain) and the actual subscriptions (what is currently established on the server).

    The subscriptions are organized by channel mode:

    • Exact: Exact channel names
    • Pattern: Channel patterns using glob-style matching
    • Sharded: Sharded channels (available since Valkey 7.0)
    const state = await clusterClient.getSubscriptions();
    console.log("Desired exact channels:", state.desiredSubscriptions[GlideClusterClientConfiguration.PubSubChannelModes.Exact]);
    console.log("Actual sharded channels:", state.actualSubscriptions[GlideClusterClientConfiguration.PubSubChannelModes.Sharded]);
    interface ClusterPubSubState {
        actualSubscriptions: Partial<
            Record<
                GlideClusterClientConfiguration.PubSubChannelModes,
                Set<GlideString>,
            >,
        >;
        desiredSubscriptions: Partial<
            Record<
                GlideClusterClientConfiguration.PubSubChannelModes,
                Set<GlideString>,
            >,
        >;
    }
    Index

    Properties

    actualSubscriptions: Partial<
        Record<
            GlideClusterClientConfiguration.PubSubChannelModes,
            Set<GlideString>,
        >,
    >

    Actual subscriptions currently active on the server. These are the subscriptions that are actually established.

    desiredSubscriptions: Partial<
        Record<
            GlideClusterClientConfiguration.PubSubChannelModes,
            Set<GlideString>,
        >,
    >

    Desired subscriptions organized by channel mode. These are the subscriptions the client wants to maintain.