Table of Contents

Class ObservableEventExtensions

Namespace
WebDriverBiDi
Assembly
WebDriverBiDi.dll

Extension methods for ObservableEvent<T>.

public static class ObservableEventExtensions
Inheritance
ObservableEventExtensions
Inherited Members

Methods

ToObservable<T>(ObservableEvent<T>)

Returns an IObservable<T> adapter for this ObservableEvent<T>, enabling integration with Reactive Extensions (Rx) operators and any code that consumes the standard IObservable<T>/IObserver<T> interfaces.

public static IObservable<T> ToObservable<T>(this ObservableEvent<T> source) where T : WebDriverBiDiEventArgs

Parameters

source ObservableEvent<T>

The ObservableEvent<T> to adapt.

Returns

IObservable<T>

An IObservable<T> whose Subscribe(IObserver<T>) method creates an independent channel-backed subscription for each caller. Each call to Subscribe(IObserver<T>) counts as one observer against MaxObserverCount.

Type Parameters

T

The type of event arguments containing information about the observable event.

Remarks

The returned IObservable<T> partially satisfies the Rx push-stream contract:

The subscription handle returned by Subscribe(IObserver<T>) is an ObservableEventSubscription<T>. Disposing it removes the subscription from the source event, completes the internal channel, and triggers OnCompleted() once the drain loop exits; its CompletionTask task completes when that has happened.

Exceptions

ArgumentNullException

Thrown when source is null.