Class: RPC

Represents an RPC advertised by a LuXoR device. To register a new RPC or find an RPC advertised by another device, see Lens.Machines and Machine. See RPCs for an overview of the RPC system.

Instance Properties

name: String

Name of this RPC.

machine: Machine

The machine advertising this RPC.

valued: Boolean

If true, this RPC returns a value.

params: Array.<String>

A list of argument names the RPC takes when called.

Instance Methods

call(args, callback) → {Promise} common/models/rpc.js, line 142

Invokes this RPC.

Argument Type Attributes Description
args Array <optional>

Array of arguments. Defaults to the empty array.

callback function <optional>

Callback that will automatically be attached to the returned Promise as a done callback.

Returns:

A jQuery Promise object that allows the caller to attach callback for when the RPC completes or fails. If this RPC is valued, any done callbacks will get the result of the RPC as an argument. If the RPC fails, the failure callbacks will get an error message as an argument.