@fluidframework/container-loader Package

Packages > @fluidframework/container-loader

Interfaces

Interface Alerts Description
ICodeDetailsLoader DEPRECATED
IContainerConfig
IContainerLoadOptions
IFluidModuleWithDetails DEPRECATED
ILoaderOptions
ILoaderProps Services and properties necessary for creating a loader
ILoaderServices Services and properties used by and exposed by the loader
IPendingContainerState State saved by a container at close time, to be used to load a new instance of the container to the same state
IProtocolHandler

Classes

Class Description
Container
Loader Manages Fluid resource loading
RelativeLoader

Enumerations

Enum Description
ConnectionState

Types

TypeAlias Description
IDetachedBlobStorage Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support blobs in detached containers.
ProtocolHandlerBuilder Function to be used for creating a protocol handler.

Functions

Function Return Type Description
waitContainerToCatchUp Promise

Waits until container connects to delta storage and gets up-to-date.

Useful when resolving URIs and hitting 404, due to container being loaded from (stale) snapshot and not being up to date. Host may chose to wait in such case and retry resolving URI.

Warning: Will wait infinitely for connection to establish if there is no connection. May result in deadlock if Container.disconnect() is called and never followed by a call to Container.connect().

Enumeration Details

ConnectionState

Signature

export declare enum ConnectionState 

Flags

Flag Description
CatchingUp The container has an inbound connection only, and is catching up to the latest known state from the service.
Connected The container is fully connected and syncing
Disconnected The container is not connected to the ordering service Note - When in this state the container may be about to reconnect, or may remain disconnected until explicitly told to connect.
EstablishingConnection The container is disconnected but actively trying to establish a new connection PLEASE NOTE that this numerical value falls out of the order you may expect for this state

FlagDetails

CatchingUp

The container has an inbound connection only, and is catching up to the latest known state from the service.

Signature
CatchingUp = 1
Connected

The container is fully connected and syncing

Signature
Connected = 2
Disconnected

The container is not connected to the ordering service Note - When in this state the container may be about to reconnect, or may remain disconnected until explicitly told to connect.

Signature
Disconnected = 0
EstablishingConnection

The container is disconnected but actively trying to establish a new connection PLEASE NOTE that this numerical value falls out of the order you may expect for this state

Signature
EstablishingConnection = 3

Type Details

IDetachedBlobStorage

Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support blobs in detached containers.

Signature

export declare type IDetachedBlobStorage = Pick<IDocumentStorageService, "createBlob" | "readBlob"> & {
    size: number;
    getBlobIds(): string[];
};

ProtocolHandlerBuilder

Function to be used for creating a protocol handler.

Signature

export declare type ProtocolHandlerBuilder = (attributes: IDocumentAttributes, snapshot: IQuorumSnapshot, sendProposal: (key: string, value: any) => number) => IProtocolHandler;

Function Details

waitContainerToCatchUp

Waits until container connects to delta storage and gets up-to-date.

Useful when resolving URIs and hitting 404, due to container being loaded from (stale) snapshot and not being up to date. Host may chose to wait in such case and retry resolving URI.

Warning: Will wait infinitely for connection to establish if there is no connection. May result in deadlock if Container.disconnect() is called and never followed by a call to Container.connect().

Signature

export declare function waitContainerToCatchUp(container: IContainer): Promise<boolean>;

Parameters

Parameter Type Description
container IContainer

Returns

true: container is up to date, it processed all the ops that were know at the time of first connection.

false: storage does not provide indication of how far the client is. Container processed all the ops known to it, but it maybe still behind.

Return type: Promise<boolean>

Throws

an error beginning with "Container closed" if the container is closed before it catches up.