Interface BatchOperations<T>

Defines batch operations available on LiveObjects.

Type Parameters

Hierarchy

Methods

Methods

  • Batch multiple operations together using a batch context, which wraps the underlying PathObject or Instance from which the batch was called. The batch context always contains a resolved instance, even when called from a PathObject. If an instance cannot be resolved from the referenced path, or if the instance is not a LiveObject, this method throws an error.

    Batching enables you to group multiple operations together and send them to the Ably service in a single channel message. As a result, other clients will receive the changes in a single channel message once the batch function has completed.

    The objects' data is not modified inside the batch function. Instead, the objects will be updated when the batched operations are applied by the Ably service and echoed back to the client.

    Parameters

    Returns Promise<void>

    A promise which resolves upon success of the batch operation and rejects with an ErrorInfo object upon its failure.

Generated using TypeDoc