Workex.Aggregate protocol
Specifies the protocol used by Workex
behaviour to aggregate incoming messages.
Summary
Functions
Adds the new item to the aggregate
Removes the oldest item from the collection
Returns the number of aggregated items
Produces an aggregated value from all collected items
Types
Functions
Removes the oldest item from the collection.
Sometimes it doesn't make sense to implement this function, for example when the aggregation doesn't guarantee or preserve ordering. In such cases, just raise from the implementation, and document that the implementation can't be used with the replace_oldest
option.
Specs
size(t) :: non_neg_integer
Returns the number of aggregated items.
This function is invoked frequently, so be sure to make the implementation fast.