Skip to main content
Version: v1

IDeltaHandler Interface

Handler provided by shared data structure to process requests from the runtime.

Signature

export interface IDeltaHandler

Properties

Property Type Description
process (message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => void Processes the op.

Methods

Method Modifiers Return Type Description
applyStashedOp(message) unknown Apply changes from an op. Used when rehydrating an attached container with pending changes. This prepares the SharedObject for seeing an ACK for the op or resubmitting the op upon reconnection.
reSubmit(message, localOpMetadata) void Called when the runtime asks the client to resubmit an op. This may be because the Container reconnected and this op was not acked. The client can choose to resubmit the same message, submit different / multiple messages or not submit anything at all.
rollback(message, localOpMetadata) optional void Revert a local op.
setConnectionState(connected) void State change events to indicate changes to the delta connection

Property Details

process

Processes the op.

Signature

process: (message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => void;

Type: (message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => void

Method Details

applyStashedOp

Apply changes from an op. Used when rehydrating an attached container with pending changes. This prepares the SharedObject for seeing an ACK for the op or resubmitting the op upon reconnection.

Signature

applyStashedOp(message: any): unknown;

Parameters

Parameter Type Description
message any Contents of a stashed op.

Returns

localMetadata of the op, to be passed to process() or resubmit() when the op is ACKed or resubmitted, respectively

Return type: unknown

reSubmit

Called when the runtime asks the client to resubmit an op. This may be because the Container reconnected and this op was not acked. The client can choose to resubmit the same message, submit different / multiple messages or not submit anything at all.

Signature

reSubmit(message: any, localOpMetadata: unknown): void;

Parameters

Parameter Type Description
message any The original message that was submitted.
localOpMetadata unknown The local metadata associated with the original message.

rollback

Revert a local op.

Signature

rollback?(message: any, localOpMetadata: unknown): void;

Parameters

Parameter Type Description
message any The original message that was submitted.
localOpMetadata unknown The local metadata associated with the original message.

setConnectionState

State change events to indicate changes to the delta connection

Signature

setConnectionState(connected: boolean): void;

Parameters

Parameter Type Description
connected boolean true if connected, false otherwise