Skip to main content
Version: Current

Remote Actions

  • os.remoteCount(inst?: string): Promise<number>

    Gets the number of remotes that are viewing the current inst. Optionally takes a parameter which is the inst that the number of remotes should be retrieved for. If omitted, then the current inst will be checked. Returns a promise that resolves with the number of active remotes.

    The first parameter is optional and is a string and is the name of the inst that the number of remotes should be retrieved for. If not specified, then the current inst current inst will be used.

    Examples
    Get the number of remotes in the current inst.
    const numberOfRemotes = await os.remoteCount();
    os.toast("Number of Remotes: " + numberOfRemotes);
    Get the number of remotes in the `test` inst.
    const numberOfRemotes = await os.remoteCount('test');
    os.toast("Number of Remotes: " + numberOfRemotes);
  • os.remotes(): Promise<string[]>

    Gets the list of remote IDs that are connected to the current inst. Returns a promise that resolves with the list of remote IDs.

    The resolved list will always have at least one value that represents the current remote.

    Examples
    Get the list of remote IDs.
    const remotes = await os.remotes();
    os.toast("Remotes " + remotes.join(','));
  • os.totalRemoteCount(): Promise<number>

    Gets the number of devices that are connected to the server. Returns a promise that resolves with the number of active devices.

    Examples
    Get the number of devices on the server.
    const numberOfDevices = await os.totalRemoteCount();
    os.toast("Number of Devices: " + numberOfDevices);