Skip to main content
Version: v1

IContainerRuntime Interface

Signature​

export interface IContainerRuntime extends IProvideContainerRuntime, IProvideFluidDataStoreRegistry, IContainerRuntimeBaseWithCombinedEvents

Extends: IProvideContainerRuntime, IProvideFluidDataStoreRegistry, IContainerRuntimeBaseWithCombinedEvents

Properties​

PropertyTypeDescription
attachStateAttachStateIndicates the attachment state of the container to a host service.
clientDetailsIClientDetails
clientIdstring | undefined
connectedboolean
deltaManagerIDeltaManager<ISequencedDocumentMessage, IDocumentMessage>
flushModeFlushMode
isDirtybooleanReturns true if document is dirty, i.e. there are some pending local changes that either were not sent out to delta stream or were not yet acknowledged.
optionsILoaderOptions
scopeFluidObject
storageIDocumentStorageService

Methods​

MethodAlertsReturn TypeDescription
createDetachedRootDataStore(pkg, rootDataStoreId)IFluidDataStoreContextDetachedCreates detached data store context. Data store initialization is considered complete only after context.attachRuntime() is called.
createRootDataStore(pkg, rootDataStoreId)DeprecatedPromise<IFluidRouter>Creates root data store in container. Such store is automatically bound to container, and thus is attached to storage when/if container is attached to storage. Such stores are never garbage collected and can be found / loaded by name. Majority of data stores in container should not be roots, and should be reachable (directly or indirectly) through one of the roots.
flush()DeprecatedvoidFlushes any ops currently being batched to the loader
getAbsoluteUrl(relativeUrl)Promise<string | undefined>Get an absolute url for a provided container-relative request. Returns undefined if the container isn't attached to storage.
getRootDataStore(id, wait)Promise<IFluidRouter>Returns the runtime of the data store.
resolveHandle(request)Promise<IResponse>Resolves handle URI

Property Details​

attachState​

Indicates the attachment state of the container to a host service.

Signature​

readonly attachState: AttachState;

Type: AttachState

clientDetails​

Signature​

readonly clientDetails: IClientDetails;

Type: IClientDetails

clientId​

Signature​

readonly clientId: string | undefined;

Type: string | undefined

connected​

Signature​

readonly connected: boolean;

Type: boolean

deltaManager​

Signature​

readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;

Type: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>

flushMode​

Signature​

readonly flushMode: FlushMode;

Type: FlushMode

isDirty​

Returns true if document is dirty, i.e. there are some pending local changes that either were not sent out to delta stream or were not yet acknowledged.

Signature​

readonly isDirty: boolean;

Type: boolean

options​

Signature​

readonly options: ILoaderOptions;

Type: ILoaderOptions

scope​

Signature​

readonly scope: FluidObject;

Type: FluidObject

storage​

Signature​

readonly storage: IDocumentStorageService;

Type: IDocumentStorageService

Method Details​

createDetachedRootDataStore​

Creates detached data store context. Data store initialization is considered complete only after context.attachRuntime() is called.

Signature​

createDetachedRootDataStore(pkg: Readonly<string[]>, rootDataStoreId: string): IFluidDataStoreContextDetached;

Parameters​

ParameterTypeDescription
pkgReadonly<string[]>package path
rootDataStoreIdstringdata store ID (unique name). Must not contain slashes.

Returns​

Return type: IFluidDataStoreContextDetached

createRootDataStore​

Creates root data store in container. Such store is automatically bound to container, and thus is attached to storage when/if container is attached to storage. Such stores are never garbage collected and can be found / loaded by name. Majority of data stores in container should not be roots, and should be reachable (directly or indirectly) through one of the roots.

This API is deprecated and will be removed in a future release.
  • will be removed in an upcoming release. See #9660.

Signature​

createRootDataStore(pkg: string | string[], rootDataStoreId: string): Promise<IFluidRouter>;

Parameters​

ParameterTypeDescription
pkgstring | string[]Package name of the data store factory
rootDataStoreIdstringdata store ID. Must not contain slashes. IDs naming space is global in container. If collision on name occurs, it results in container corruption - loading this file after that will always result in error.

Returns​

Return type: Promise<IFluidRouter>

flush​

Flushes any ops currently being batched to the loader

This API is deprecated and will be removed in a future release.
  • This will be removed in a later release. If a more manual flushing process is needed, move all usage to IContainerRuntimeBase.orderSequentially if possible.

Signature​

flush(): void;

getAbsoluteUrl​

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

Signature​

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

Parameters​

ParameterTypeDescription
relativeUrlstringA relative request within the container

Returns​

Return type: Promise<string | undefined>

getRootDataStore​

Returns the runtime of the data store.

Signature​

getRootDataStore(id: string, wait?: boolean): Promise<IFluidRouter>;

Parameters​

ParameterModifiersTypeDescription
idstringId supplied during creating the data store.
waitoptionalbooleanTrue if you want to wait for it.

Returns​

Return type: Promise<IFluidRouter>

resolveHandle​

Resolves handle URI

Signature​

resolveHandle(request: IRequest): Promise<IResponse>;

Parameters​

ParameterTypeDescription
requestIRequestrequest to resolve

Returns​

Return type: Promise<IResponse>