Top Description Inners Fields Constructors Methods
rx.internal.operators

public final Class OnSubscribeAmb<T>

extends Object
implements Observable.OnSubscribe<T>
Class Inheritance
All Implemented Interfaces
rx.Observable.OnSubscribe, rx.functions.Action1, rx.functions.Action, rx.functions.Function
Type Parameters
<T>
the value type
Imports
java.util.*, java.util.concurrent.ConcurrentLinkedQueue, java.util.concurrent.atomic.AtomicReference, rx.*, .Observable, .Observable.OnSubscribe, rx.functions.Action0, rx.subscriptions.Subscriptions

Given multiple Observables, propagates the one that first emits an item.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final Iterable<? extends Observable<? extends T>>

Constructor Summary

AccessConstructor and Description
private
OnSubscribeAmb(Iterable<? extends Observable<? extends T>> sources)

Method Summary

Modifier and TypeMethod and Description
public static <
the common value base type
T
>
Observable.OnSubscribe<T>

Returns:

an Observable that mirrors the one of the source Observables that was first to emit an item
amb
(Observable<? extends T>
the first Observable
o1
,
Observable<? extends T>
the second Observable
o2
)

Given two Observables, propagates the one that first emits an item.

public static <
the common value base type
T
>
Observable.OnSubscribe<T>

Returns:

an Observable that mirrors the one of the source Observables that was first to emit an item
amb
(Observable<? extends T>
the first Observable
o1
,
Observable<? extends T>
the second Observable
o2
,
Observable<? extends T>
the third Observable
o3
)

Given three Observables, propagates the one that first emits an item.

public static <
the common value base type
T
>
Observable.OnSubscribe<T>

Returns:

an Observable that mirrors the one of the source Observables that was first to emit an item
amb
(Observable<? extends T>
the first Observable
o1
,
Observable<? extends T>
the second Observable
o2
,
Observable<? extends T>
the third Observable
o3
,
Observable<? extends T>
the fourth Observable
o4
)

Given four Observables, propagates the one that first emits an item.

public static <
the common value base type
T
>
Observable.OnSubscribe<T>

Returns:

an Observable that mirrors the one of the source Observables that was first to emit an item
amb
(Observable<? extends T>
the first Observable
o1
,
Observable<? extends T>
the second Observable
o2
,
Observable<? extends T>
the third Observable
o3
,
Observable<? extends T>
the fourth Observable
o4
,
Observable<? extends T>
the fifth Observable
o5
)

Given five Observables, propagates the one that first emits an item.

public static <
the common value base type
T
>
Observable.OnSubscribe<T>

Returns:

an Observable that mirrors the one of the source Observables that was first to emit an item
amb
(Observable<? extends T>
the first Observable
o1
,
Observable<? extends T>
the second Observable
o2
,
Observable<? extends T>
the third Observable
o3
,
Observable<? extends T>
the fourth Observable
o4
,
Observable<? extends T>
the fifth Observable
o5
,
Observable<? extends T>
the sixth Observable
o6
)

Given six Observables, propagates the one that first emits an item.

public static <
the common value base type
T
>
Observable.OnSubscribe<T>

Returns:

an Observable that mirrors the one of the source Observables that was first to emit an item
amb
(Observable<? extends T>
the first Observable
o1
,
Observable<? extends T>
the second Observable
o2
,
Observable<? extends T>
the third Observable
o3
,
Observable<? extends T>
the fourth Observable
o4
,
Observable<? extends T>
the fifth Observable
o5
,
Observable<? extends T>
the sixth Observable
o6
,
Observable<? extends T>
the seventh Observable
o7
)

Given seven Observables, propagates the one that first emits an item.

public static <
the common value base type
T
>
Observable.OnSubscribe<T>

Returns:

an Observable that mirrors the one of the source Observables that was first to emit an item
amb
(Observable<? extends T>
the first Observable
o1
,
Observable<? extends T>
the second Observable
o2
,
Observable<? extends T>
the third Observable
o3
,
Observable<? extends T>
the fourth Observable
o4
,
Observable<? extends T>
the fifth Observable
o5
,
Observable<? extends T>
the sixth Observable
o6
,
Observable<? extends T>
the seventh Observable
o7
,
Observable<? extends T>
the eighth Observable
o8
)

Given eight Observables, propagates the one that first emits an item.

public static <
the common value base type
T
>
Observable.OnSubscribe<T>

Returns:

an Observable that mirrors the one of the source Observables that was first to emit an item
amb
(Observable<? extends T>
the first Observable
o1
,
Observable<? extends T>
the second Observable
o2
,
Observable<? extends T>
the third Observable
o3
,
Observable<? extends T>
the fourth Observable
o4
,
Observable<? extends T>
the fifth Observable
o5
,
Observable<? extends T>
the sixth Observable
o6
,
Observable<? extends T>
the seventh Observable
o7
,
Observable<? extends T>
the eighth Observable
o8
,
Observable<? extends T>
the ninth Observable
o9
)

Given nine Observables, propagates the one that first emits an item.

public static <
the common value base type
T
>
Observable.OnSubscribe<T>

Returns:

an Observable that mirrors the one of the Observables in sources that was the first to emit an item
amb
(final Iterable<? extends Observable<? extends T>>
an Iterable of Observables
sources
)

Given a set of Observables, propagates the one that first emits an item.

public void
call(final Subscriber<? super T> subscriber)

Implements rx.functions.Action1.call.

pack-priv static <T> void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sourcesback to summary
pack-priv final Iterable<? extends Observable<? extends T>> sources

Constructor Detail

OnSubscribeAmbback to summary
private OnSubscribeAmb(Iterable<? extends Observable<? extends T>> sources)

Method Detail

ambback to summary
public static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2)

Given two Observables, propagates the one that first emits an item.

Parameters
<T>
the common value base type
o1:Observable<? extends T>

the first Observable

o2:Observable<? extends T>

the second Observable

Returns:Observable.OnSubscribe<T>

an Observable that mirrors the one of the source Observables that was first to emit an item

ambback to summary
public static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3)

Given three Observables, propagates the one that first emits an item.

Parameters
<T>
the common value base type
o1:Observable<? extends T>

the first Observable

o2:Observable<? extends T>

the second Observable

o3:Observable<? extends T>

the third Observable

Returns:Observable.OnSubscribe<T>

an Observable that mirrors the one of the source Observables that was first to emit an item

ambback to summary
public static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4)

Given four Observables, propagates the one that first emits an item.

Parameters
<T>
the common value base type
o1:Observable<? extends T>

the first Observable

o2:Observable<? extends T>

the second Observable

o3:Observable<? extends T>

the third Observable

o4:Observable<? extends T>

the fourth Observable

Returns:Observable.OnSubscribe<T>

an Observable that mirrors the one of the source Observables that was first to emit an item

ambback to summary
public static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4, Observable<? extends T> o5)

Given five Observables, propagates the one that first emits an item.

Parameters
<T>
the common value base type
o1:Observable<? extends T>

the first Observable

o2:Observable<? extends T>

the second Observable

o3:Observable<? extends T>

the third Observable

o4:Observable<? extends T>

the fourth Observable

o5:Observable<? extends T>

the fifth Observable

Returns:Observable.OnSubscribe<T>

an Observable that mirrors the one of the source Observables that was first to emit an item

ambback to summary
public static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4, Observable<? extends T> o5, Observable<? extends T> o6)

Given six Observables, propagates the one that first emits an item.

Parameters
<T>
the common value base type
o1:Observable<? extends T>

the first Observable

o2:Observable<? extends T>

the second Observable

o3:Observable<? extends T>

the third Observable

o4:Observable<? extends T>

the fourth Observable

o5:Observable<? extends T>

the fifth Observable

o6:Observable<? extends T>

the sixth Observable

Returns:Observable.OnSubscribe<T>

an Observable that mirrors the one of the source Observables that was first to emit an item

ambback to summary
public static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4, Observable<? extends T> o5, Observable<? extends T> o6, Observable<? extends T> o7)

Given seven Observables, propagates the one that first emits an item.

Parameters
<T>
the common value base type
o1:Observable<? extends T>

the first Observable

o2:Observable<? extends T>

the second Observable

o3:Observable<? extends T>

the third Observable

o4:Observable<? extends T>

the fourth Observable

o5:Observable<? extends T>

the fifth Observable

o6:Observable<? extends T>

the sixth Observable

o7:Observable<? extends T>

the seventh Observable

Returns:Observable.OnSubscribe<T>

an Observable that mirrors the one of the source Observables that was first to emit an item

ambback to summary
public static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4, Observable<? extends T> o5, Observable<? extends T> o6, Observable<? extends T> o7, Observable<? extends T> o8)

Given eight Observables, propagates the one that first emits an item.

Parameters
<T>
the common value base type
o1:Observable<? extends T>

the first Observable

o2:Observable<? extends T>

the second Observable

o3:Observable<? extends T>

the third Observable

o4:Observable<? extends T>

the fourth Observable

o5:Observable<? extends T>

the fifth Observable

o6:Observable<? extends T>

the sixth Observable

o7:Observable<? extends T>

the seventh Observable

o8:Observable<? extends T>

the eighth Observable

Returns:Observable.OnSubscribe<T>

an Observable that mirrors the one of the source Observables that was first to emit an item

ambback to summary
public static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4, Observable<? extends T> o5, Observable<? extends T> o6, Observable<? extends T> o7, Observable<? extends T> o8, Observable<? extends T> o9)

Given nine Observables, propagates the one that first emits an item.

Parameters
<T>
the common value base type
o1:Observable<? extends T>

the first Observable

o2:Observable<? extends T>

the second Observable

o3:Observable<? extends T>

the third Observable

o4:Observable<? extends T>

the fourth Observable

o5:Observable<? extends T>

the fifth Observable

o6:Observable<? extends T>

the sixth Observable

o7:Observable<? extends T>

the seventh Observable

o8:Observable<? extends T>

the eighth Observable

o9:Observable<? extends T>

the ninth Observable

Returns:Observable.OnSubscribe<T>

an Observable that mirrors the one of the source Observables that was first to emit an item

ambback to summary
public static <T> Observable.OnSubscribe<T> amb(final Iterable<? extends Observable<? extends T>> sources)

Given a set of Observables, propagates the one that first emits an item.

Parameters
<T>
the common value base type
sources:Iterable<? extends Observable<? extends T>>

an Iterable of Observables

Returns:Observable.OnSubscribe<T>

an Observable that mirrors the one of the Observables in sources that was the first to emit an item

callback to summary
public void call(final Subscriber<? super T> subscriber)

Implements rx.functions.Action1.call.

Annotations
@Override
unsubscribeAmbSubscribersback to summary
pack-priv static <T> void unsubscribeAmbSubscribers(Collection<OnSubscribeAmb.AmbSubscriber<T>> ambSubscribers)
rx.internal.operators back to summary

pack-priv final Class OnSubscribeAmb.AmbSubscriber<T>

extends Subscriber<T>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private boolean
private final OnSubscribeAmb.Selection<T>
private final Subscriber<? super T>

Constructor Summary

AccessConstructor and Description
pack-priv
AmbSubscriber(long requested, Subscriber<? super T> subscriber, OnSubscribeAmb.Selection<T> selection)

Method Summary

Modifier and TypeMethod and Description
private boolean
public void
onCompleted()

Implements rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.
public void
onError(Throwable
the exception encountered by the Observable
e
)

Implements rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.
public void
onNext(T
the item emitted by the Observable
t
)

Implements rx.Observer.onNext.

Provides the Observer with a new item to observe.
private void
requestMore(long n)

Inherited from rx.Subscriber:
addisUnsubscribedonStartrequestsetProducerunsubscribe

Field Detail

chosenback to summary
private boolean chosen
selectionback to summary
private final OnSubscribeAmb.Selection<T> selection
subscriberback to summary
private final Subscriber<? super T> subscriber

Hides rx.Subscriber.subscriber.

Constructor Detail

AmbSubscriberback to summary
pack-priv AmbSubscriber(long requested, Subscriber<? super T> subscriber, OnSubscribeAmb.Selection<T> selection)

Method Detail

isSelectedback to summary
private boolean isSelected()
onCompletedback to summary
public void onCompleted()

Implements rx.Observer.onCompleted.

Doc from rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.

The Observable will not call this method if it calls onError.

Annotations
@Override
onErrorback to summary
public void onError(Throwable e)

Implements rx.Observer.onError.

Doc from rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.

If the Observable calls this method, it will not thereafter call onNext or onCompleted.

Parameters
e:Throwable

the exception encountered by the Observable

Annotations
@Override
onNextback to summary
public void onNext(T t)

Implements rx.Observer.onNext.

Doc from rx.Observer.onNext.

Provides the Observer with a new item to observe.

The Observable may call this method 0 or more times.

The Observable will not call this method again after it calls either onCompleted or onError.

Parameters
t:T

the item emitted by the Observable

Annotations
@Override
requestMoreback to summary
private void requestMore(long n)
rx.internal.operators back to summary

pack-priv final Class OnSubscribeAmb.Selection<T>

extends AtomicReference<OnSubscribeAmb.AmbSubscriber<T>>
Class Inheritance
Annotations
@SuppressWarnings:serial

Field Summary

Modifier and TypeField and Description
pack-priv final Collection<OnSubscribeAmb.AmbSubscriber<T>>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public void
Inherited from java.util.concurrent.atomic.AtomicReference:
accumulateAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetgetgetAcquiregetAndAccumulategetAndSetgetAndUpdategetOpaquegetPlainlazySetsetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

ambSubscribersback to summary
pack-priv final Collection<OnSubscribeAmb.AmbSubscriber<T>> ambSubscribers

Constructor Detail

Selectionback to summary
pack-priv Selection()

Method Detail

unsubscribeLosersback to summary
public void unsubscribeLosers()
unsubscribeOthersback to summary
public void unsubscribeOthers(OnSubscribeAmb.AmbSubscriber<T> notThis)