Class TakeUntil
Represents an operator that returns elements from the first sequence only until the second sequence emits a notification.
TakeUntil modifies the source sequence so that values are emitted only until the second sequence produces a value. At that time, TakeUntil will terminate immediately and ignore the remainder of the sequence. TakeUntil is often used to create a dynamic stop condition for an infinite sequence, e.g. grab frames from a video camera until a key is pressed.
If the source sequence terminates before the second sequence produces a value, TakeUntil will also terminate and cancel the subscription to the second sequence.
[Combinator]
public class TakeUntil
- Inheritance
-
TakeUntil
- Inherited Members
Methods
Process<TSource, TOther>(IObservable<TSource>, IObservable<TOther>)
Returns elements from an observable sequence only until the second sequence emits a notification.
public IObservable<TSource> Process<TSource, TOther>(IObservable<TSource> source, IObservable<TOther> other)
Parameters
sourceIObservable<TSource>The sequence to take elements from.
otherIObservable<TOther>The observable sequence indicating the time at which to stop taking elements from the
sourcesequence.
Returns
- IObservable<TSource>
An observable sequence containing the elements of the
sourcesequence emitted until theothersequence emits a notification.
Type Parameters
TSourceThe type of the elements in the
sourcesequence.TOtherThe type of the elements in the
othersequence.