Skip to content 

IContainer Interface

Packages > @fluidframework/container-definitions > IContainer

The Host’s view of the Container and its connection to storage

Signature:

export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter 

Extends: IEventProvider<IContainerEvents>, IFluidRouter

Properties

List of properties of this interface
Property Type Description
attachState AttachState Indicates the attachment state of the container to a host service.
deltaManager IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> The Delta Manager supporting the op stream for this Container
resolvedUrl IResolvedUrl | undefined Represents the resolved url to the Container

Methods

List of methods of this class
Method Description
attach(request) Attaches the Container to the Container specified by the given Request.TODO - in the case of failure options should give a retry policy. Or some continuation function that allows attachment to a secondary document.
getAbsoluteUrl(relativeUrl) Get an absolute url for a provided container-relative request url. If the container is not attached, this will return undefined.
getQuorum() The collection of write clients which were connected as of the current sequence number. Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.
request(request) Issue a request against the container for a resource.
serialize() Extract the snapshot from the detached container.

Events

attachState

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

Signature:

readonly attachState: AttachState;

deltaManager

The Delta Manager supporting the op stream for this Container

Signature:

deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;

resolvedUrl

Represents the resolved url to the Container

Signature:

resolvedUrl: IResolvedUrl | undefined;

Methods

attach

Attaches the Container to the Container specified by the given Request.

TODO - in the case of failure options should give a retry policy. Or some continuation function that allows attachment to a secondary document.

Signature:

attach(request: IRequest): Promise<void>;

Parameters

List of parameters
Parameter Type Description
request IRequest

Returns:

Promise<void>

getAbsoluteUrl

Get an absolute url for a provided container-relative request url. If the container is not attached, this will return undefined.

Signature:

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

Parameters

List of parameters
Parameter Type Description
relativeUrl string A container-relative request URL

Returns:

Promise<string | undefined>

getQuorum

The collection of write clients which were connected as of the current sequence number. Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.

Signature:

getQuorum(): IQuorum;

Returns:

IQuorum

request

Issue a request against the container for a resource.

Signature:

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

Parameters

List of parameters
Parameter Type Description
request IRequest The request to be issued against the container

Returns:

Promise<IResponse>

serialize

Extract the snapshot from the detached container.

Signature:

serialize(): string;

Returns:

string