@fluidframework/ordered-collection Package

Packages > @fluidframework/ordered-collection

Classes

List of classes contained in this package or namespace
Class Description
ConsensusOrderedCollection Implementation of a consensus collection shared objectImplements the shared object's communication, and the semantics around the release/complete mechanism following acquire.Generally not used directly. A derived type will pass in a backing data type IOrderedCollection that will define the deterministic add/acquire order and snapshot ability.
ConsensusQueue Implementation of a consensus stackAn derived type of ConsensusOrderedCollection with a queue as the backing data and order.

Enumerations

List of enums contained in this package or namespace
Enumeration Description
ConsensusResult

Functions

List of functions contained in this package or namespace
Function Description
acquireAndComplete(collection) Helper method to acquire and complete an item Should be used in test code only
waitAcquireAndComplete(collection) Helper method to acquire and complete an item Should be used in test code only

Interfaces

List of interfaces contained in this package or namespace
Interface Description
IConsensusOrderedCollection Consensus Ordered Collection interfaceAn consensus ordered collection is a distributed data structure, which holds a collection of JSON-able or handles, and has a deterministic add/remove order.
IConsensusOrderedCollectionEvents Events notifying about addition, acquisition, release and completion of items
IConsensusOrderedCollectionFactory Consensus Ordered Collection channel factory interfaceExtends the base IChannelFactory to return a more definite type of IConsensusOrderedCollection Use for the runtime to create and load distributed data structure by type name of each channel
IOrderedCollection Ordered Collection interfaceCollection of objects that has deterministic add and remove ordering. Object implementing this interface can be used as the data backing for the ConsensusOrderedCollection
ISnapshotable Interface for object that can be snapshotedTODO: move this to be use in other place TODO: currently input and output is not symmetrical, can they become symmetrical?

Type Aliases

List of type aliases contained in this package or namespace
Type Alias Description
ConsensusCallback Callback provided to acquire() and waitAndAcquire() methods.

Enumerations

ConsensusResult enum

Signature:

export declare enum ConsensusResult 

Enumeration Members

List of members in use in this enum
Member Value Description
Complete 1
Release 0

Functions

acquireAndComplete

Helper method to acquire and complete an item Should be used in test code only

Signature:

export declare function acquireAndComplete<T>(collection: IConsensusOrderedCollection<T>): Promise<T | undefined>;

Parameters

List of parameters
Parameter Type Description
collection IConsensusOrderedCollection

Returns:

Promise<T | undefined>

waitAcquireAndComplete

Helper method to acquire and complete an item Should be used in test code only

Signature:

export declare function waitAcquireAndComplete<T>(collection: IConsensusOrderedCollection<T>): Promise<T>;

Parameters

List of parameters
Parameter Type Description
collection IConsensusOrderedCollection

Returns:

Promise<T>

Type Aliases

ConsensusCallback

Callback provided to acquire() and waitAndAcquire() methods.

Signature:

export declare type ConsensusCallback<T> = (value: T) => Promise<ConsensusResult>;