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

PropertyTypeDescription
process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => voidProcesses the op.

Methods

MethodModifiersReturn TypeDescription
applyStashedOp(message)unknownApply 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)voidCalled 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)optionalvoidRevert a local op.
setConnectionState(connected)voidState 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

ParameterTypeDescription
messageanyContents 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

ParameterTypeDescription
messageanyThe original message that was submitted.
localOpMetadataunknownThe local metadata associated with the original message.

rollback

Revert a local op.

Signature

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

Parameters

ParameterTypeDescription
messageanyThe original message that was submitted.
localOpMetadataunknownThe local metadata associated with the original message.

setConnectionState

State change events to indicate changes to the delta connection

Signature

setConnectionState(connected: boolean): void;

Parameters

ParameterTypeDescription
connectedbooleantrue if connected, false otherwise