RTCForge API Reference v1.1.1
    Preparing search index...

    Interface PlacementStrategy

    Pluggable policy for choosing which SFU node should serve a given room.

    Implementations receive the set of candidate nodes (already filtered to healthy, non-draining nodes by the SfuCluster) and return the chosen node, or undefined when no candidate is suitable.

    • LeastLoadedStrategy
    • HashRingStrategy
    interface PlacementStrategy {
        select(
            candidates: SfuNode[],
            region?: string,
            key?: string,
        ): SfuNode | undefined;
    }

    Implemented by

    Index

    Methods

    Methods

    • Select a node from the candidate set.

      Parameters

      • candidates: SfuNode[]

        Eligible nodes to choose from.

      • Optionalregion: string

        Optional preferred region; strategies typically restrict selection to nodes in this region when any exist, otherwise fall back to the full set.

      • Optionalkey: string

        Optional routing key (for example the room id) used by deterministic strategies to map the same key to the same node.

      Returns SfuNode | undefined

      The selected node, or undefined when candidates is empty.