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

Property Alerts Modifiers Type Description
attachState Alpha readonly AttachState Indicates the attachment state of the data store to a host service.
channelsRoutingContext Alpha readonly IFluidHandleContext
clientId Alpha readonly string | undefined
connected Alpha readonly boolean
deltaManager Alpha readonly IDeltaManagerErased
entryPoint Alpha readonly IFluidHandle<FluidObject> Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting with it.
id Alpha readonly string
idCompressor Alpha readonly IIdCompressor | undefined An optional ID compressor.
IFluidHandleContext Alpha readonly IFluidHandleContext
isReadOnly Alpha readonly () => boolean Get the current readonly state.
logger Alpha readonly ITelemetryBaseLogger
objectsRoutingContext Alpha readonly IFluidHandleContext
options Alpha readonly Record<string | number, any>
rootRoutingContext Alpha readonly IFluidHandleContext
submitSignal Alpha (type: string, content: unknown, targetClientId?: string) => void Submits the signal to be sent to other clients.

Methods

Method Alerts Return Type Description
addChannel(channel) Alpha void This api allows adding channel to data store after it was created. This allows callers to cusmomize channel instance. For example, 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.
bindChannel(channel) Alpha void Bind the channel with the data store runtime. If the runtime is attached then we attach the channel to make it live.
createChannel(id, type) Alpha IChannel Creates a new channel of the given type.
getAudience() Alpha IAudience Returns the current audience.
getChannel(id) Alpha Promise<IChannel> Returns the channel with the given id
getQuorum() Alpha IQuorumClients Returns the current quorum.
uploadBlob(blob, signal) Alpha Promise<IFluidHandle<ArrayBufferLike>> Api to upload a blob of data.
waitAttached() Alpha Promise<void> Resolves when a local data store is attached.

Property Details

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.

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
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.

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
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.

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
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.

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
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.

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
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.

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
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.

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
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.

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
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.

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
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.

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
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.

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
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.

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
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.

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
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.

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
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.

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
submitSignal: (type: string, content: unknown, targetClientId?: string) => void;

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

Method Details

addChannel

This api allows adding channel to data store after it was created. This allows callers to cusmomize channel instance. For example, 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.

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

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
addChannel(channel: IChannel): void;

Parameters

Parameter Type Description
channel IChannel channel 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.

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
bindChannel(channel: IChannel): void;

Parameters

Parameter Type Description
channel IChannel

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.

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
createChannel(id: string | undefined, type: string): IChannel;

Parameters

Parameter Type Description
id string | undefined ID of the channel to be created. A unique ID will be generated if left undefined.
type string Type 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.

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
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.

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
getChannel(id: string): Promise<IChannel>;

Parameters

Parameter Type Description
id string

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.

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
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.

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
uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;

Parameters

Parameter Modifiers Type Description
blob ArrayBufferLike blob to be uploaded.
signal optional AbortSignal

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.

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
waitAttached(): Promise<void>;

Returns

Return type: Promise<void>