Class StateSynchronizer

A class that wraps a StateTracker and is responsible for synchronizing its state updates with the remote RPCs. It batches updates to optimize performance and handles the communication with the remote system.

Constructors

  • Creates a new StateSynchronizer instance.

    Parameters

    • rpc: RpcSafeClient

      The RPC client used to communicate with the remote system

    • getHandle: () => number

      Function that returns the current handle identifier

    • isConnected: () => boolean

      Function that returns whether the connection to the remote system is active

    • onUpdate: () => void

      Callback function invoked when updates are sent to the remote system

    • defaultState: NodeState = NodeState.VISIBLE

      The default state for nodes when not explicitly set (defaults to VISIBLE)

    Returns StateSynchronizer

Methods