@fluidframework/container-loader Package

Packages > @fluidframework/container-loader

Classes

List of classes contained in this package or namespace
Class Description
Audience Audience represents all clients connected to the op stream.
CollabWindowTracker
Container
DeltaManager Manages the flow of both inbound and outbound messages. This class ensures that shared objects receive delta messages in order regardless of possible network conditions or timings causing out of order delivery.
Loader Manages Fluid resource loading
RelativeLoader
RetriableDocumentStorageService

Enumerations

List of enums contained in this package or namespace
Enumeration Description
ConnectionState
ReconnectMode

Functions

List of functions contained in this package or namespace
Function Description
convertProtocolAndAppSummaryToSnapshotTree(protocolSummaryTree, appSummaryTree) Combine and convert protocol and app summary tree to format which is readable by container while rehydrating.
parseUrl(url)
runWithRetry(api, fetchCallName, deltaManager, logger, shouldRetry)
waitContainerToCatchUp(container) 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.setAutoReconnect(false) is called and never switched back to auto-reconnect.

Interfaces

List of interfaces contained in this package or namespace
Interface Description
IConnectionArgs
IContainerConfig
IContainerLoadOptions
IDeltaManagerInternalEvents Includes events emitted by the concrete implementation DeltaManager but not exposed on the public interface IDeltaManager
ILoaderProps Services and properties necessary for creating a loader
ILoaderServices Services and properties used by and exposed by the loader
IParsedUrl

Variables

List of variables contained in this package or namespace
Variable Description
getSnapshotTreeFromSerializedContainer

Enumerations

ConnectionState enum

Signature:

export declare enum ConnectionState 

Enumeration Members

List of members in use in this enum
Member Value Description
Connected 2 The document is fully connected
Connecting 1 The document has an inbound connection but is still pending for outbound deltas
Disconnected 0 The document is no longer connected to the delta server

ReconnectMode enum

Signature:

export declare enum ReconnectMode 

Enumeration Members

List of members in use in this enum
Member Value Description
Disabled "Disabled"
Enabled "Enabled"
Never "Never"

Functions

convertProtocolAndAppSummaryToSnapshotTree

Combine and convert protocol and app summary tree to format which is readable by container while rehydrating.

Signature:

export declare function convertProtocolAndAppSummaryToSnapshotTree(protocolSummaryTree: ISummaryTree, appSummaryTree: ISummaryTree): ISnapshotTree;

Parameters

List of parameters
Parameter Type Description
protocolSummaryTree ISummaryTree Protocol Summary Tree
appSummaryTree ISummaryTree App Summary Tree

Returns:

ISnapshotTree

parseUrl

Signature:

export declare function parseUrl(url: string): IParsedUrl | undefined;

Parameters

List of parameters
Parameter Type Description
url string

Returns:

IParsedUrl | undefined

runWithRetry

Signature:

export declare function runWithRetry<T>(api: () => Promise<T>, fetchCallName: string, deltaManager: Pick<DeltaManager, "emitDelayInfo" | "refreshDelayInfo">, logger: ITelemetryLogger, shouldRetry?: () => {
    retry: boolean;
    error: any | undefined;
}): Promise<T>;

Parameters

List of parameters
Parameter Type Description
api () => Promise
fetchCallName string
deltaManager Pick<DeltaManager, "emitDelayInfo" | "refreshDelayInfo">
logger ITelemetryLogger
shouldRetry () => { retry: boolean; error: any | undefined; }

Returns:

Promise<T>

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.setAutoReconnect(false) is called and never switched back to auto-reconnect.

Signature:

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

Parameters

List of parameters
Parameter Type Description
container Container

Returns:

Promise<boolean>

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.

Variables

getSnapshotTreeFromSerializedContainer

Signature:

getSnapshotTreeFromSerializedContainer: (detachedContainerSnapshot: ISummaryTree) => ISnapshotTree