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 eventType
is 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 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 eventType
is 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:EXPIRED
orstreams:RESET
.
-
Return Type
(anydata) Updated count.
Returns a copy of the Count
aggregator without its current state.
-
Return Type
(Aggregator) Returns
Count
aggregator.
Return current state to be saved as a map of any
typed values.
-
Return Type
(map) A map of
any
typed values.
Restores the saved state which is passed as a map of any
typed values.
Parameters
- state map
-
A map of typed
any
values. This map contains the values to be restored from the persisted data.