Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Aggregator<V>

Wrapper for an aggregate function.

By default, if multiple users set a value on a CVar, CValueMap, or CMap concurrently, one value is picked arbitrarily. You can supply an Aggregator in their constructor to instead apply aggregate to the concurrently-set values, returning your desired value.

For example, our whiteboard demo takes the RGB average of concurrently-set colors, thus blending concurrent strokes.

Type Parameters

  • V

Hierarchy

  • Aggregator

Index

Properties

lamportTimestamp?: boolean

If true, MultiValueMapItem.lamportTimestamp is present in aggregated items.

wallClockTime?: boolean

If true, MultiValueMapItem.wallClockTime is present in aggregated items.

Methods

  • The aggregate function, called on concurrently-set values plus metadata (as MultiValueMapItems).

    items is always non-empty, and its order is eventually consistent. Specifically, it is in order by [[MultiValueMapItem.sender]].

    Parameters

    Returns V

    The aggregated value.

Generated using TypeDoc