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>
public final class OnSubscribeAmb<T> extends java.lang.Object implements Observable.OnSubscribe<T>
Given multipleObservables, propagates the one that first emits an item.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classOnSubscribeAmb.AmbSubscriber<T>(package private) static classOnSubscribeAmb.Selection<T>
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.Iterable<? extends Observable<? extends T>>sources
-
Constructor Summary
Constructors Modifier Constructor Description privateOnSubscribeAmb(java.lang.Iterable<? extends Observable<? extends T>> sources)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Observable.OnSubscribe<T>amb(java.lang.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(java.util.Collection<OnSubscribeAmb.AmbSubscriber<T>> ambSubscribers)
-
-
-
Field Detail
-
sources
final java.lang.Iterable<? extends Observable<? extends T>> sources
-
-
Constructor Detail
-
OnSubscribeAmb
private OnSubscribeAmb(java.lang.Iterable<? extends Observable<? extends T>> sources)
-
-
Method Detail
-
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(java.lang.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
public void call(Subscriber<? super T> subscriber)
-
unsubscribeAmbSubscribers
static <T> void unsubscribeAmbSubscribers(java.util.Collection<OnSubscribeAmb.AmbSubscriber<T>> ambSubscribers)
-
-