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

    Class LeastLoadedStrategy

    PlacementStrategy that picks the candidate node with the lowest current load.

    When a region is given it prefers nodes in that region, falling back to the full candidate set if none match, then returns the least-loaded node from the chosen pool. Ignores the routing key — placement is purely load-driven, which spreads rooms evenly but does not keep a given room pinned to one node across calls. For stable pinning use HashRingStrategy.

    Implements

    Index

    Constructors

    Methods

    Constructors

    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.

      • Optional_key: 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.