Object -
streams
:
Count
Aggregator to count events in streams.
Methods
Updates the current count when a new event arrives and return the updated count. If the eventType is
streams:CURRENT, count is increase by 1. If the eventType is streams:EXPIRED, count is descreased by 1.
If the eventTypeis streams:RESET, count is reset, regardless the value.
Returns a copy of the Count aggregator without its current state.
Return current state to be saved as a map of any typed values.
Restores the saved state which is passed as a map of any typed values.
Fields
- count int (default 0)
-
description
Updates the current count when a new event arrives and return the updated count. If the eventType is
streams:CURRENT, count is increase by 1. If the eventType is streams:EXPIRED, count is descreased by 1.
If the eventTypeis streams:RESET, count is reset, regardless the value.
Parameters
- value anydata
-
In count aggregator the value is not used.
- eventType EventType
-
Type of the incoming event
streams:CURRENT,streams:EXPIREDorstreams:RESET.
-
Return Type
(anydata) Updated count.
Returns a copy of the Count aggregator without its current state.
-
Return Type
(Aggregator) Returns
Countaggregator.
Return current state to be saved as a map of any typed values.
-
Return Type
(map) A map of
anytyped values.