Package rx.internal.operators
Class OnSubscribeAmb<T>
java.lang.Object
rx.internal.operators.OnSubscribeAmb<T>
- Type Parameters:
T- the value type
- All Implemented Interfaces:
Action,Action1<Subscriber<? super T>>,Function,Observable.OnSubscribe<T>
Given multiple
Observables, propagates the one that first emits an item.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Iterable<? extends Observable<? extends T>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateOnSubscribeAmb(Iterable<? extends Observable<? extends T>> sources) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Observable.OnSubscribe<T> amb(Iterable<? extends Observable<? extends T>> sources) Given a set ofObservables, propagates the one that first emits an item.static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2) Given twoObservables, propagates the one that first emits an item.static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3) Given threeObservables, propagates the one that first emits an item.static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4) Given fourObservables, propagates the one that first emits an item.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 fiveObservables, propagates the one that first emits an item.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 sixObservables, propagates the one that first emits an item.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 sevenObservables, propagates the one that first emits an item.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 eightObservables, propagates the one that first emits an item.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 nineObservables, propagates the one that first emits an item.voidcall(Subscriber<? super T> subscriber) (package private) static <T> voidunsubscribeAmbSubscribers(Collection<OnSubscribeAmb.AmbSubscriber<T>> ambSubscribers)
-
Field Details
-
sources
-
-
Constructor Details
-
OnSubscribeAmb
-
-
Method Details
-
amb
public static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2) Given twoObservables, propagates the one that first emits an item.- Type Parameters:
T- the common value base type- Parameters:
o1- the firstObservableo2- the secondObservable- Returns:
- an
Observablethat mirrors the one of the sourceObservables that was first to emit an item
-
amb
public static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3) Given threeObservables, propagates the one that first emits an item.- Type Parameters:
T- the common value base type- Parameters:
o1- the firstObservableo2- the secondObservableo3- the thirdObservable- Returns:
- an
Observablethat mirrors the one of the sourceObservables that was first to emit an item
-
amb
public static <T> Observable.OnSubscribe<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4) Given fourObservables, propagates the one that first emits an item.- Type Parameters:
T- the common value base type- Parameters:
o1- the firstObservableo2- the secondObservableo3- the thirdObservableo4- the fourthObservable- Returns:
- an
Observablethat mirrors the one of the sourceObservables that was first to emit an item
-
amb
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 fiveObservables, propagates the one that first emits an item.- Type Parameters:
T- the common value base type- Parameters:
o1- the firstObservableo2- the secondObservableo3- the thirdObservableo4- the fourthObservableo5- the fifthObservable- Returns:
- an
Observablethat mirrors the one of the sourceObservables that was first to emit an item
-
amb
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 sixObservables, propagates the one that first emits an item.- Type Parameters:
T- the common value base type- Parameters:
o1- the firstObservableo2- the secondObservableo3- the thirdObservableo4- the fourthObservableo5- the fifthObservableo6- the sixthObservable- Returns:
- an
Observablethat mirrors the one of the sourceObservables that was first to emit an item
-
amb
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 sevenObservables, propagates the one that first emits an item.- Type Parameters:
T- the common value base type- Parameters:
o1- the firstObservableo2- the secondObservableo3- the thirdObservableo4- the fourthObservableo5- the fifthObservableo6- the sixthObservableo7- the seventhObservable- Returns:
- an
Observablethat mirrors the one of the sourceObservables that was first to emit an item
-
amb
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 eightObservables, propagates the one that first emits an item.- Type Parameters:
T- the common value base type- Parameters:
o1- the firstObservableo2- the secondObservableo3- the thirdObservableo4- the fourthObservableo5- the fifthObservableo6- the sixthObservableo7- the seventhObservableo8- the eighthObservable- Returns:
- an
Observablethat mirrors the one of the sourceObservables that was first to emit an item
-
amb
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 nineObservables, propagates the one that first emits an item.- Type Parameters:
T- the common value base type- Parameters:
o1- the firstObservableo2- the secondObservableo3- the thirdObservableo4- the fourthObservableo5- the fifthObservableo6- the sixthObservableo7- the seventhObservableo8- the eighthObservableo9- the ninthObservable- Returns:
- an
Observablethat mirrors the one of the sourceObservables that was first to emit an item
-
amb
public static <T> Observable.OnSubscribe<T> amb(Iterable<? extends Observable<? extends T>> sources) Given a set ofObservables, propagates the one that first emits an item.- Type Parameters:
T- the common value base type- Parameters:
sources- anIterableofObservables- Returns:
- an
Observablethat mirrors the one of theObservables insourcesthat was the first to emit an item
-
call
-
unsubscribeAmbSubscribers
static <T> void unsubscribeAmbSubscribers(Collection<OnSubscribeAmb.AmbSubscriber<T>> ambSubscribers)
-