Table of Contents

Class Amb

Namespace
Bonsai.Reactive
Assembly
Bonsai.Core.dll

Represents an operator that propagates the observable sequence that reacts first.

Marble diagram

The Amb operator sets up a winner-take-all race condition between all source sequences. The first sequence to emit a notification will gain full control of the output, and all the other sequences will have their subscriptions immediatelly cancelled. Amb is most commonly used to ensure only one of many outcomes being evaluated in parallel is propagated.

[Combinator]
public class Amb
Inheritance
Amb
Inherited Members

Methods

Process<TSource>(IObservable<TSource>, IObservable<TSource>)

Propagates the observable sequence that reacts first.

public IObservable<TSource> Process<TSource>(IObservable<TSource> first, IObservable<TSource> second)

Parameters

first IObservable<TSource>

First observable sequence.

second IObservable<TSource>

Second observable sequence.

Returns

IObservable<TSource>

An observable sequence that surfaces either of the given sequences, whichever reacted first.

Type Parameters

TSource

The type of the elements in the source sequences.

Process<TSource>(params IObservable<TSource>[])

Propagates the observable sequence that reacts first.

public IObservable<TSource> Process<TSource>(params IObservable<TSource>[] sources)

Parameters

sources IObservable<TSource>[]

Observable sources competing to react first.

Returns

IObservable<TSource>

An observable sequence that surfaces any of the given sequences, whichever reacted first.

Type Parameters

TSource

The type of the elements in the source sequences.