Skip to content 

IFluidDataStoreRuntime Interface

Packages > @fluidframework/datastore-definitions > IFluidDataStoreRuntime

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

Signature:

export interface IFluidDataStoreRuntime extends IFluidRouter, EventEmitter, IDisposable, Partial<IProvideFluidDataStoreRegistry> 

Extends: IFluidRouter, EventEmitter, IDisposable, Partial<IProvideFluidDataStoreRegistry>

Properties

List of properties of this interface
Property Type Description
attachState AttachState Indicates the attachment state of the data store to a host service.
clientId string | undefined
connected boolean
deltaManager IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>
documentId string
existing boolean
id string
IFluidHandleContext IFluidHandleContext
IFluidSerializer IFluidSerializer
loader ILoader
logger ITelemetryLogger
options any
parentBranch string | null

Methods

List of methods of this class
Method Description
bindChannel(channel) 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) Creates a new channel of the given type.
getAudience() Returns the current audience.
getBlob(blobId) Api to get the blob for a particular id.
getBlobMetadata() Api to get the blob metadata.
getChannel(id) Returns the channel with the given id
getQuorum() Returns the current quorum.
on(event, listener)
on(event, listener)
on(event, listener)
on(event, listener)
raiseContainerWarning(warning) Errors raised by distributed data structures
snapshot(message) Api for generating the snapshot of the data store.
submitSignal(type, content) Submits the signal to be sent to other clients.
uploadBlob(file) Api to upload a blob of data.
waitAttached() Resolves when a local data store is attached.

Events

attachState

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

Signature:

readonly attachState: AttachState;

clientId

Signature:

readonly clientId: string | undefined;

connected

Signature:

readonly connected: boolean;

deltaManager

Signature:

readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;

documentId

Signature:

readonly documentId: string;

existing

Signature:

readonly existing: boolean;

id

Signature:

readonly id: string;

IFluidHandleContext

Signature:

readonly IFluidHandleContext: IFluidHandleContext;

IFluidSerializer

Signature:

readonly IFluidSerializer: IFluidSerializer;

loader

Signature:

readonly loader: ILoader;

logger

Signature:

readonly logger: ITelemetryLogger;

options

Signature:

readonly options: any;

parentBranch

Signature:

readonly parentBranch: string | null;

Methods

bindChannel

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

Signature:

bindChannel(channel: IChannel): void;

Parameters

List of parameters
Parameter Type Description
channel IChannel

Returns:

void

createChannel

Creates a new channel of the given type.

Signature:

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

Parameters

List of 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:

IChannel

getAudience

Returns the current audience.

Signature:

getAudience(): IAudience;

Returns:

IAudience

getBlob

Api to get the blob for a particular id.

Signature:

getBlob(blobId: string): Promise<IGenericBlob | undefined>;

Parameters

List of parameters
Parameter Type Description
blobId string ID of the required blob.

Returns:

Promise<IGenericBlob | undefined>

getBlobMetadata

Api to get the blob metadata.

Signature:

getBlobMetadata(): Promise<IGenericBlob[]>;

Returns:

Promise<IGenericBlob[]>

getChannel

Returns the channel with the given id

Signature:

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

Parameters

List of parameters
Parameter Type Description
id string

Returns:

Promise<IChannel>

getQuorum

Returns the current quorum.

Signature:

getQuorum(): IQuorum;

Returns:

IQuorum

on

Signature:

on(event: "disconnected" | "dispose" | "leader" | "notleader" | "attaching" | "attached", listener: () => void): this;

Parameters

List of parameters
Parameter Type Description
event "disconnected" | "dispose" | "leader" | "notleader" | "attaching" | "attached"
listener () => void

Returns:

this

on

Signature:

on(event: "op", listener: (message: ISequencedDocumentMessage) => void): this;

Parameters

List of parameters
Parameter Type Description
event "op"
listener (message: ISequencedDocumentMessage) => void

Returns:

this

on

Signature:

on(event: "signal", listener: (message: IInboundSignalMessage, local: boolean) => void): this;

Parameters

List of parameters
Parameter Type Description
event "signal"
listener (message: IInboundSignalMessage, local: boolean) => void

Returns:

this

on

Signature:

on(event: "connected", listener: (clientId: string) => void): this;

Parameters

List of parameters
Parameter Type Description
event "connected"
listener (clientId: string) => void

Returns:

this

raiseContainerWarning

Errors raised by distributed data structures

Signature:

raiseContainerWarning(warning: ContainerWarning): void;

Parameters

List of parameters
Parameter Type Description
warning ContainerWarning

Returns:

void

snapshot

Api for generating the snapshot of the data store.

Signature:

snapshot(message: string): Promise<void>;

Parameters

List of parameters
Parameter Type Description
message string Message for the snapshot.

Returns:

Promise<void>

submitSignal

Submits the signal to be sent to other clients.

Signature:

submitSignal(type: string, content: any): void;

Parameters

List of parameters
Parameter Type Description
type string Type of the signal.
content any Content of the signal.

Returns:

void

uploadBlob

Api to upload a blob of data.

Signature:

uploadBlob(file: IGenericBlob): Promise<IGenericBlob>;

Parameters

List of parameters
Parameter Type Description
file IGenericBlob blob to be uploaded.

Returns:

Promise<IGenericBlob>

waitAttached

Resolves when a local data store is attached.

Signature:

waitAttached(): Promise<void>;

Returns:

Promise<void>