Table of Contents

Class Count

Namespace
Bonsai.Reactive
Assembly
Bonsai.Core.dll

Represents an operator that returns the count of the number of elements in an observable sequence.

Marble diagram

The Count operator collects all the values from the source sequence and emits a single value representing the total number of items. The single result value is emitted only when the source sequence terminates successfully.

Example

Use Count to report the total count of elements at the end of a sequence.

Count Example

Alternative

Use ElementIndex instead to continuously track the number of elements in the sequence.

public class Count : Combinator<int>
Inheritance
Count
Inherited Members

Methods

Process<TSource>(IObservable<TSource>)

Returns the count of the number of elements in an observable sequence.