- Hands-On Reactive Programming in Spring 5
- Oleh Dokuka Igor Lozynskyi
- 83字
- 2025-03-01 03:48:41
Count operator
The count operator is pretty descriptive; it emits the only value with the number of elements in the input stream. However, the count emits at the moment when the original stream completes, so, in the case of an endless stream, the count will not ever finish or return anything, as shown in the following diagram:

Diagram 2.9 Count o perator: counts the number of items emitted by the Observable source and emit only this value