@fluidframework/ordered-collection Package
Packages > @fluidframework/ordered-collection
Classes
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
Enumeration | Description |
---|---|
ConsensusResult |
Functions
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
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
Type Alias | Description |
---|---|
ConsensusCallback | Callback provided to acquire() and waitAndAcquire() methods. |
Enumerations
ConsensusResult enum
Signature:
export declare enum ConsensusResult
Enumeration Members
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
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
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>;