Skip to content 

IContainerRuntimeBase Interface

Packages > @fluidframework/runtime-definitions > IContainerRuntimeBase

A reduced set of functionality of IContainerRuntime that a data store context/data store runtime will need TODO: this should be merged into IFluidDataStoreContext

Signature:

export interface IContainerRuntimeBase extends EventEmitter, IProvideFluidHandleContext, IProvideFluidSerializer, IProvideFluidDataStoreRegistry 

Extends: EventEmitter, IProvideFluidHandleContext, IProvideFluidSerializer, IProvideFluidDataStoreRegistry

Properties

List of properties of this interface
Property Type Description
clientDetails IClientDetails
logger ITelemetryLogger

Methods

List of methods of this class
Method Description
createDataStore(pkg) Creates data store. Returns router of data store. Data store is not bound to container, store in such state is not persisted to storage (file). Storing a handle to this store (or any of its parts, like DDS) into already attached DDS (or non-attached DDS that will eventually gets attached to storage) will result in this store being attached to storage.
createDetachedDataStore() Creates detached data store context. only after context.attachRuntime() is called, data store initialization is considered compete.
getAbsoluteUrl(relativeUrl) Get an absolute url for a provided container-relative request. Returns undefined if the container or data store isn't attached to storage.
getTaskManager()
on(event, listener)
on(event, listener)
on(event, listener)
on(event, listener)
on(event, listener)
orderSequentially(callback) Invokes the given callback and guarantees that all operations generated within the callback will be ordered sequentially. Total size of all messages must be less than maxOpSize.
setFlushMode(mode) Sets the flush mode for operations on the document.
submitSignal(type, content) Submits a container runtime level signal to be sent to other clients.

Events

clientDetails

Signature:

readonly clientDetails: IClientDetails;

logger

Signature:

readonly logger: ITelemetryLogger;

Methods

createDataStore

Creates data store. Returns router of data store. Data store is not bound to container, store in such state is not persisted to storage (file). Storing a handle to this store (or any of its parts, like DDS) into already attached DDS (or non-attached DDS that will eventually gets attached to storage) will result in this store being attached to storage.

Signature:

createDataStore(pkg: string | string[]): Promise<IFluidRouter>;

Parameters

List of parameters
Parameter Type Description
pkg string | string[] Package name of the data store factory

Returns:

Promise<IFluidRouter>

createDetachedDataStore

Creates detached data store context. only after context.attachRuntime() is called, data store initialization is considered compete.

Signature:

createDetachedDataStore(): IFluidDataStoreContextDetached;

Returns:

IFluidDataStoreContextDetached

getAbsoluteUrl

Get an absolute url for a provided container-relative request. Returns undefined if the container or data store isn’t attached to storage.

Signature:

getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;

Parameters

List of parameters
Parameter Type Description
relativeUrl string A relative request within the container

Returns:

Promise<string | undefined>

getTaskManager

Signature:

getTaskManager(): Promise<ITaskManager>;

Returns:

Promise<ITaskManager>

on

Signature:

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

Parameters

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

Returns:

this

on

Signature:

on(event: "batchEnd", listener: (error: any, op: ISequencedDocumentMessage) => void): this;

Parameters

List of parameters
Parameter Type Description
event "batchEnd"
listener (error: any, op: ISequencedDocumentMessage) => 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: "leader" | "notleader", listener: () => void): this;

Parameters

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

Returns:

this

orderSequentially

Invokes the given callback and guarantees that all operations generated within the callback will be ordered sequentially. Total size of all messages must be less than maxOpSize.

Signature:

orderSequentially(callback: () => void): void;

Parameters

List of parameters
Parameter Type Description
callback () => void

Returns:

void

setFlushMode

Sets the flush mode for operations on the document.

Signature:

setFlushMode(mode: FlushMode): void;

Parameters

List of parameters
Parameter Type Description
mode FlushMode

Returns:

void

submitSignal

Submits a container runtime level 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