Skip to main content
Version: v2

IDeltaHandler Interface

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

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/datastore-definitions/legacy.

For more information about our API support guarantees, see here.

Signature​

export interface IDeltaHandler

Properties​

PropertyAlertsTypeDescription
processMessagesBeta(messageCollection: IRuntimeMessageCollection) => voidProcess messages for this channel. The messages here are contiguous messages for this channel in a batch.

Methods​

MethodAlertsModifiersReturn TypeDescription
applyStashedOp(message)BetavoidApply changes from an op just as if a local client has made the change, including submitting the 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, squash)BetavoidCalled 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)BetaoptionalvoidRevert a local op.
setConnectionState(connected)BetavoidState change events to indicate changes to the delta connection

Property Details​

processMessages​

Process messages for this channel. The messages here are contiguous messages for this channel in a batch.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

processMessages: (messageCollection: IRuntimeMessageCollection) => void;

Type: (messageCollection: IRuntimeMessageCollection) => void

Method Details​

applyStashedOp​

Apply changes from an op just as if a local client has made the change, including submitting the 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.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

applyStashedOp(message: any): void;

Parameters​

ParameterTypeDescription
messageany

Returns​

Should return void.

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.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

reSubmit(message: any, localOpMetadata: unknown, squash?: boolean): void;

Parameters​

ParameterModifiersTypeDescription
messageanyThe original message that was submitted.
localOpMetadataunknownThe local metadata associated with the original message.
squashoptionalbooleanIf true, the DDS should avoid resubmitting any "unnecessary intermediate state" created by this message. This includes any content which this message created but has since been changed or removed by subsequent messages. For example, if this message (call it A) inserts content into a DDS that a subsequent op (call it B) removes, resubmission of this message (call it A') should avoid inserting that content, and resubmission of the subsequent op that removed it (B') would account for the fact that A' never inserted content.

rollback​

Revert a local op.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

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

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

setConnectionState(connected: boolean): void;

Parameters​

ParameterTypeDescription
connectedbooleantrue if connected, false otherwise