Skip to main content

MockContainerRuntimeForReconnection Class

Specialized implementation of MockContainerRuntime for testing ops during reconnection.

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

To use, import via @fluidframework/test-runtime-utils/legacy.

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

Signature

export declare class MockContainerRuntimeForReconnection extends MockContainerRuntime

Extends: MockContainerRuntime

Constructors

ConstructorAlertsDescription
(constructor)(dataStoreRuntime, factory, runtimeOptions, overrides)BetaConstructs a new instance of the MockContainerRuntimeForReconnection class

Properties

PropertyAlertsModifiersTypeDescription
connectedBetabooleanReturns the connection state of the container runtime. Any messages that are submitted while not connected will be resubmitted via the resubmit flow on reconnection. Any messages received while disconnected will be processed on reconnection. Also, the clientId of the runtime will change on reconnection.
factoryBetareadonlyMockContainerRuntimeFactoryForReconnection
pendingRemoteMessagesBetareadonlyISequencedDocumentMessage[]Contains messages from other clients that were sequenced while this runtime was marked as disconnected.
processedOpsBetaoptional, readonlyISequencedDocumentMessage[]

Methods

MethodAlertsReturn TypeDescription
flush()Betavoid
initializeWithStashedOps(fromContainerRuntime)BetaPromise<void>
process(message)Betavoid
processPendingMessages(pendingMessages)Betavoid
setConnectedState(connected)Betavoid
submit(messageContent, localOpMetadata)Betanumber

Constructor Details

(constructor)

Constructs a new instance of the MockContainerRuntimeForReconnection class

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

constructor(dataStoreRuntime: MockFluidDataStoreRuntime, factory: MockContainerRuntimeFactoryForReconnection, runtimeOptions?: IMockContainerRuntimeOptions, overrides?: {
minimumSequenceNumber?: number;
trackRemoteOps?: boolean;
});

Parameters

ParameterModifiersTypeDescription
dataStoreRuntimeMockFluidDataStoreRuntime
factoryMockContainerRuntimeFactoryForReconnection
runtimeOptionsoptionalIMockContainerRuntimeOptions
overridesoptional{ minimumSequenceNumber?: number; trackRemoteOps?: boolean; }

Property Details

connected

Returns the connection state of the container runtime. Any messages that are submitted while not connected will be resubmitted via the resubmit flow on reconnection. Any messages received while disconnected will be processed on reconnection. Also, the clientId of the runtime will change on 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

get connected(): boolean;

set connected(connected: boolean);

Type: boolean

factory

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

protected readonly factory: MockContainerRuntimeFactoryForReconnection;

Type: MockContainerRuntimeFactoryForReconnection

pendingRemoteMessages

Contains messages from other clients that were sequenced while this runtime was marked as disconnected.

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

protected readonly pendingRemoteMessages: ISequencedDocumentMessage[];

Type: ISequencedDocumentMessage[]

processedOps

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

protected readonly processedOps?: ISequencedDocumentMessage[];

Type: ISequencedDocumentMessage[]

Method Details

flush

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

flush(): void;

initializeWithStashedOps

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

initializeWithStashedOps(fromContainerRuntime: MockContainerRuntimeForReconnection): Promise<void>;

Parameters

ParameterTypeDescription
fromContainerRuntimeMockContainerRuntimeForReconnection

Returns

Return type: Promise<void>

process

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

process(message: ISequencedDocumentMessage): void;

Parameters

ParameterTypeDescription
messageISequencedDocumentMessage

processPendingMessages

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

protected processPendingMessages(pendingMessages: ISequencedDocumentMessage[]): void;

Parameters

ParameterTypeDescription
pendingMessagesISequencedDocumentMessage[]

setConnectedState

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

protected setConnectedState(connected: boolean): void;

Parameters

ParameterTypeDescription
connectedboolean

submit

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

submit(messageContent: any, localOpMetadata: unknown): number;

Parameters

ParameterTypeDescription
messageContentany
localOpMetadataunknown

Returns

Return type: number