@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.
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.
logNetworkFailure(logger, event, error)
parseUrl(url)
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.
waitForConnectedState(minDelay) Wait for browser to get to connected state. If connected, waits minimum of minDelay anyway (between network retries) If disconnected, polls every 30 seconds anyway, to make sure we are not getting stuck because of wrong signal Note that browsers will have false positives (like having Hyper-V adapter on machine, or machine connected to router that is not connected to internet) But there should be no false negatives. The only exception - Opera returns false when user enters "Work Offline" mode, regardless of actual connectivity.

Interfaces

List of interfaces contained in this package or namespace
Interface Description
IConnectionArgs
IContainerConfig
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
getRetryDelayFromError

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

logNetworkFailure

Signature:

export declare function logNetworkFailure(logger: ITelemetryLogger, event: ITelemetryErrorEvent, error?: any): void;

Parameters

List of parameters
Parameter Type Description
logger ITelemetryLogger
event ITelemetryErrorEvent
error any

Returns:

void

parseUrl

Signature:

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

Parameters

List of parameters
Parameter Type Description
url string

Returns:

IParsedUrl | undefined

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.

waitForConnectedState

Wait for browser to get to connected state. If connected, waits minimum of minDelay anyway (between network retries) If disconnected, polls every 30 seconds anyway, to make sure we are not getting stuck because of wrong signal Note that browsers will have false positives (like having Hyper-V adapter on machine, or machine connected to router that is not connected to internet) But there should be no false negatives. The only exception - Opera returns false when user enters “Work Offline” mode, regardless of actual connectivity.

Signature:

export declare function waitForConnectedState(minDelay: number): Promise<void>;

Parameters

List of parameters
Parameter Type Description
minDelay number

Returns:

Promise<void>

Variables

getRetryDelayFromError

Signature:

getRetryDelayFromError: (error: any) => number | undefined