Class AuditOperator
The audit/auditTime operators.
public static class AuditOperator
- Inheritance
-
System.ObjectAuditOperator
Methods
AuditTime<T>(Observable<T>, TimeSpan, IScheduler?)
Audit<T, TDuration>(Observable<T>, Func<T, Observable<TDuration>>) with a fixed TimeSpan window instead of a per-value duration
selector. Built on top of Audit<T, TDuration>(Observable<T>, Func<T, Observable<TDuration>>) using Timer(TimeSpan, IScheduler?) — safe to
reuse (unlike Delay, see its own remarks) because Audit only ever has one duration subscription
active at a time, so there is no concurrent-timer ordering hazard.
public static Observable<T> AuditTime<T>(this Observable<T> source, TimeSpan duration, IScheduler? scheduler = null)
Parameters
sourceObservable<T>The source observable.
durationTimeSpanThe fixed window length.
schedulerISchedulerThe scheduler to time the window with; defaults to TaskPoolScheduler.
Returns
- Observable<T>
An observable that emits the most recent value once each window closes.
Type Parameters
TThe element type of the source.
Audit<T, TDuration>(Observable<T>, Func<T, Observable<TDuration>>)
Emits the most recent source value once a "duration" window elapses, ignoring values that arrive while a
window is already open (the inverse of debounce, which restarts its timer on every new value instead
of ignoring values mid-window). A window opens on the first value seen while idle, via
durationSelector(that value); the window closes — and the latest pending value is emitted
— as soon as the duration observable emits or completes. Mirrors rxjs's audit.
public static Observable<T> Audit<T, TDuration>(this Observable<T> source, Func<T, Observable<TDuration>> durationSelector)
Parameters
sourceObservable<T>The source observable.
durationSelectorFunc<T, Observable<TDuration>>Given the value that opened the current window, returns the observable whose first emission or completion closes it.
Returns
- Observable<T>
An observable that emits the most recent value once each window closes.
Type Parameters
TThe element type of the source.
TDurationThe (unused) element type of the duration observable.