IDeltaHandler Interface
Handler provided by shared data structure to process requests from the runtime.
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 | Type | Description |
---|---|---|---|
processMessages | Alpha |
(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, squash) | 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
processMessages
Process messages for this channel. The messages here are contiguous messages for this channel in a batch.
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.
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.
For more information about our API support guarantees, see here.
Signature
reSubmit(message: any, localOpMetadata: unknown, squash?: boolean): void;
Parameters
Parameter | Modifiers | Type | Description |
---|---|---|---|
message | any | The original message that was submitted. | |
localOpMetadata | unknown | The local metadata associated with the original message. | |
squash | optional | boolean | If 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.
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
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 |