Skip to main content

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

Property Alerts Modifiers Type Description
process Deprecated, Alpha (message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => void Processes the op.
processMessages Alpha optional (messageCollection: IRuntimeMessageCollection) => void Process messages for this channel. The messages here are contiguous messages for this channel in a batch.

Methods

Method Alerts Modifiers Return Type Description
applyStashedOp(message) Alpha void 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.
reSubmit(message, localOpMetadata) Alpha 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) Alpha optional void Revert a local op.
setConnectionState(connected) Alpha void State change events to indicate changes to the delta connection

Property Details

process

Processes the op.

This API is deprecated and will be removed in a future release.
  • Use processMessages instead to process messages.
This API is provided as an alpha preview and may change without notice.

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

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

Signature

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

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

processMessages

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

This API is provided as an alpha preview and may change without notice.

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

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 as an alpha preview and may change without notice.

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

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

Signature

applyStashedOp(message: any): void;

Parameters

Parameter Type Description
message any

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 as an alpha preview and may change without notice.

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

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

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.

This API is provided as an alpha preview and may change without notice.

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

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

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

This API is provided as an alpha preview and may change without notice.

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

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

Signature

setConnectionState(connected: boolean): void;

Parameters

Parameter Type Description
connected boolean true if connected, false otherwise