Skip to main content

IFluidDataStoreRuntime Interface

Represents the runtime for the data store. Contains helper functions/state of the data store.

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.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature

/** @sealed */
export interface IFluidDataStoreRuntime extends IEventProvider<IFluidDataStoreRuntimeEvents>, IDisposable

Extends: IEventProvider<IFluidDataStoreRuntimeEvents>, IDisposable

Properties

PropertyAlertsModifiersTypeDescription
activeLocalOperationActivityBetaoptional, readonly"applyStashed" | "rollback" | undefinedIndicates the current local operation activity being performed by the data store runtime.
attachStateBetareadonlyAttachStateIndicates the attachment state of the data store to a host service.
channelsRoutingContextBetareadonlyIFluidHandleContext
clientIdBetareadonlystring | undefined
connectedBetareadonlyboolean
deltaManagerBetareadonlyIDeltaManagerErased
entryPointBetareadonlyIFluidHandle<FluidObject>Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting with it.
idBetareadonlystring
idCompressorBetareadonlyIIdCompressor | undefinedAn optional ID compressor.
IFluidHandleContextBetareadonlyIFluidHandleContext
isReadOnlyBetareadonly() => booleanGet the current readonly state.
loggerBetareadonlyITelemetryBaseLogger
objectsRoutingContextBetareadonlyIFluidHandleContext
optionsBetareadonlyRecord<string | number, any>
rootRoutingContextBetareadonlyIFluidHandleContext
submitSignalBeta(type: string, content: unknown, targetClientId?: string) => voidSubmits the signal to be sent to other clients.

Methods

MethodAlertsReturn TypeDescription
addChannel(channel)BetavoidAdds an existing channel to the data store.
bindChannel(channel)BetavoidBind the channel with the data store runtime. If the runtime is attached then we attach the channel to make it live.
createChannel(id, type)BetaIChannelCreates a new channel of the given type.
getAudience()BetaIAudienceReturns the current audience.
getChannel(id)BetaPromise<IChannel>Returns the channel with the given id
getQuorum()BetaIQuorumClientsReturns the current quorum.
uploadBlob(blob, signal)BetaPromise<IFluidHandle<ArrayBufferLike>>Api to upload a blob of data.
waitAttached()BetaPromise<void>Resolves when a local data store is attached.

Property Details

activeLocalOperationActivity

Indicates the current local operation activity being performed by the data store runtime.

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

readonly activeLocalOperationActivity?: "applyStashed" | "rollback" | undefined;

Type: "applyStashed" | "rollback" | undefined

Remarks

This property allows consumers to know when the runtime itself is actively making changes to data store DDSes. When this property is not undefined, consumers should expect to see state modifications initiated by the runtime rather than by the consumer directly: - "applyStashed" - The runtime is applying previously stashed operations during reconnection or container load. Stashed operations are local changes that were submitted but not yet acknowledged when a container was closed, and are being reapplied to restore the expected local state. - "rollback" - The runtime is rolling back (reverting) local operations that the user has chosen not to submit. This occurs when operations are being discarded, such as when exiting staging mode without committing changes. - undefined - No local operation activity is currently in progress.

attachState

Indicates the attachment state of the data store to a host service.

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

readonly attachState: AttachState;

Type: AttachState

channelsRoutingContext

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

readonly channelsRoutingContext: IFluidHandleContext;

Type: IFluidHandleContext

clientId

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

readonly clientId: string | undefined;

Type: string | undefined

connected

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

readonly connected: boolean;

Type: boolean

deltaManager

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

readonly deltaManager: IDeltaManagerErased;

Type: IDeltaManagerErased

entryPoint

Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting with it.

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

readonly entryPoint: IFluidHandle<FluidObject>;

Type: IFluidHandle<FluidObject>

id

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

readonly id: string;

Type: string

idCompressor

An optional ID compressor.

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

readonly idCompressor: IIdCompressor | undefined;

Type: IIdCompressor | undefined

Remarks

When provided, can be used to compress and decompress IDs stored in this datastore. Some SharedObjects, like SharedTree, require this.

IFluidHandleContext

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

readonly IFluidHandleContext: IFluidHandleContext;

Type: IFluidHandleContext

isReadOnly

Get the current readonly state.

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

readonly isReadOnly: () => boolean;

Type: () => boolean

logger

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

readonly logger: ITelemetryBaseLogger;

Type: ITelemetryBaseLogger

objectsRoutingContext

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

readonly objectsRoutingContext: IFluidHandleContext;

Type: IFluidHandleContext

options

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

readonly options: Record<string | number, any>;

Type: Record<string | number, any>

rootRoutingContext

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

readonly rootRoutingContext: IFluidHandleContext;

Type: IFluidHandleContext

submitSignal

Submits the signal to be sent to other clients.

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

submitSignal: (type: string, content: unknown, targetClientId?: string) => void;

Type: (type: string, content: unknown, targetClientId?: string) => void

Method Details

addChannel

Adds an existing channel to the data store.

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

addChannel(channel: IChannel): void;

Remarks

This allows callers to customize channel instance.

For example, a channel implementation could have various modes of operations. As long as such configuration is provided at creation and stored in summaries (such that all users of such channel instance behave the same), this could be useful technique to have customized solutions without introducing a number of data structures that all have same implementation.

This is also useful for scenarios like SharedTree DDS, where schema is provided at creation and stored in a summary.

The channel type should be present in the registry, otherwise the runtime would reject the channel. The runtime used to create the channel object should be same to which it is added.

Parameters

ParameterTypeDescription
channelIChannelchannel which needs to be added to the runtime.

bindChannel

Bind the channel with the data store runtime. If the runtime is attached then we attach the channel to make it live.

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

bindChannel(channel: IChannel): void;

Parameters

ParameterTypeDescription
channelIChannel

createChannel

Creates a new channel of the given type.

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

createChannel(id: string | undefined, type: string): IChannel;

Parameters

ParameterTypeDescription
idstring | undefinedID of the channel to be created. A unique ID will be generated if left undefined.
typestringType of the channel.

Returns

Return type: IChannel

getAudience

Returns the current audience.

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

getAudience(): IAudience;

Returns

Return type: IAudience

getChannel

Returns the channel with the given id

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

getChannel(id: string): Promise<IChannel>;

Parameters

ParameterTypeDescription
idstring

Returns

Return type: Promise<IChannel>

getQuorum

Returns the current quorum.

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

getQuorum(): IQuorumClients;

Returns

Return type: IQuorumClients

uploadBlob

Api to upload a blob of data.

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

uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;

Parameters

ParameterModifiersTypeDescription
blobArrayBufferLikeblob to be uploaded.
signaloptionalAbortSignal

Returns

Return type: Promise<IFluidHandle<ArrayBufferLike>>

waitAttached

Resolves when a local data store is attached.

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

waitAttached(): Promise<void>;

Returns

Return type: Promise<void>