Top Description Inners Fields Constructors Methods
rx.internal.operators

public final Class OnSubscribeFlatMapSingle<T, R>

extends Object
implements Observable.OnSubscribe<R>
Class Inheritance
All Implemented Interfaces
rx.Observable.OnSubscribe, rx.functions.Action1, rx.functions.Action, rx.functions.Function
Type Parameters
<T>
the upstream value type
<R>
the inner Singles and result value type
Imports
java.util.Queue, java.util.concurrent.atomic.*, rx.*, rx.exceptions.Exceptions, rx.functions.Func1, rx.internal.util.ExceptionsUtils, rx.internal.util.atomic.MpscLinkedAtomicQueue, rx.internal.util.unsafe.*, rx.plugins.RxJavaHooks, rx.subscriptions.CompositeSubscription

Maps upstream values to Singles and merges them, up to a given number of them concurrently, optionally delaying errors.

History: 1.2.7 - experimental

Since
1.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
pack-priv final Func1<? super T, ? extends Single<? extends R>>
pack-priv final int
pack-priv final Observable<T>

Constructor Summary

AccessConstructor and Description
public
OnSubscribeFlatMapSingle(Observable<T> source, Func1<? super T, ? extends Single<? extends R>> mapper, boolean delayErrors, int maxConcurrency)

Method Summary

Modifier and TypeMethod and Description
public void
call(Subscriber<? super R> child)

Implements rx.functions.Action1.call.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delayErrorsback to summary
pack-priv final boolean delayErrors
mapperback to summary
pack-priv final Func1<? super T, ? extends Single<? extends R>> mapper
maxConcurrencyback to summary
pack-priv final int maxConcurrency
sourceback to summary
pack-priv final Observable<T> source

Constructor Detail

OnSubscribeFlatMapSingleback to summary
public OnSubscribeFlatMapSingle(Observable<T> source, Func1<? super T, ? extends Single<? extends R>> mapper, boolean delayErrors, int maxConcurrency)

Method Detail

callback to summary
public void call(Subscriber<? super R> child)

Implements rx.functions.Action1.call.

Annotations
@Override
rx.internal.operators back to summary

pack-priv final Class OnSubscribeFlatMapSingle.FlatMapSingleSubscriber<T, R>

extends Subscriber<T>
Class Inheritance

Nested and Inner Type Summary

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

Field Summary

Modifier and TypeField and Description
pack-priv final AtomicInteger
pack-priv final Subscriber<? super R>
pack-priv volatile boolean
pack-priv final boolean
pack-priv volatile boolean
pack-priv final AtomicReference<Throwable>
pack-priv final Func1<? super T, ? extends Single<? extends R>>
pack-priv final int
pack-priv final Queue<Object>
pack-priv final OnSubscribeFlatMapSingle.FlatMapSingleSubscriber<T, R>.Requested
pack-priv final CompositeSubscription
pack-priv final AtomicInteger

Constructor Summary

AccessConstructor and Description
pack-priv
FlatMapSingleSubscriber(Subscriber<? super R> actual, Func1<? super T, ? extends Single<? extends R>> mapper, boolean delayErrors, int maxConcurrency)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
pack-priv void
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.
Inherited from rx.Subscriber:
addisUnsubscribedonStartrequestsetProducerunsubscribe

Field Detail

activeback to summary
pack-priv final AtomicInteger active
actualback to summary
pack-priv final Subscriber<? super R> actual
cancelledback to summary
pack-priv volatile boolean cancelled
delayErrorsback to summary
pack-priv final boolean delayErrors
doneback to summary
pack-priv volatile boolean done
errorsback to summary
pack-priv final AtomicReference<Throwable> errors
mapperback to summary
pack-priv final Func1<? super T, ? extends Single<? extends R>> mapper
maxConcurrencyback to summary
pack-priv final int maxConcurrency
queueback to summary
pack-priv final Queue<Object> queue
requestedback to summary
pack-priv final OnSubscribeFlatMapSingle.FlatMapSingleSubscriber<T, R>.Requested requested

Hides rx.Subscriber.requested.

setback to summary
pack-priv final CompositeSubscription set
wipback to summary
pack-priv final AtomicInteger wip

Constructor Detail

FlatMapSingleSubscriberback to summary
pack-priv FlatMapSingleSubscriber(Subscriber<? super R> actual, Func1<? super T, ? extends Single<? extends R>> mapper, boolean delayErrors, int maxConcurrency)

Method Detail

drainback to summary
pack-priv void drain()
innerErrorback to summary
pack-priv void innerError(OnSubscribeFlatMapSingle.FlatMapSingleSubscriber<T, R>.InnerSubscriber inner, Throwable e)
innerSuccessback to summary
pack-priv void innerSuccess(OnSubscribeFlatMapSingle.FlatMapSingleSubscriber<T, R>.InnerSubscriber inner, R value)
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
rx.internal.operators back to summary

pack-priv final Class OnSubscribeFlatMapSingle.FlatMapSingleSubscriber.InnerSubscriber

extends SingleSubscriber<R>
Class Inheritance

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
onError(Throwable
the exception encountered by the Single
error
)

Implements abstract rx.SingleSubscriber.onError.

Notifies the SingleSubscriber that the Single has experienced an error condition.
public void
onSuccess(R
the item emitted by the Single
t
)

Implements abstract rx.SingleSubscriber.onSuccess.

Notifies the SingleSubscriber with a single item and that the Single has finished sending push-based notifications.
Inherited from rx.SingleSubscriber:
addisUnsubscribedunsubscribe

Constructor Detail

InnerSubscriberback to summary
pack-priv InnerSubscriber()

Method Detail

onErrorback to summary
public void onError(Throwable error)

Implements abstract rx.SingleSubscriber.onError.

Doc from rx.SingleSubscriber.onError.

Notifies the SingleSubscriber that the Single has experienced an error condition.

If the Single calls this method, it will not thereafter call onSuccess.

Parameters
error:Throwable

the exception encountered by the Single

Annotations
@Override
onSuccessback to summary
public void onSuccess(R t)

Implements abstract rx.SingleSubscriber.onSuccess.

Doc from rx.SingleSubscriber.onSuccess.

Notifies the SingleSubscriber with a single item and that the Single has finished sending push-based notifications.

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

Parameters
t:R

the item emitted by the Single

Annotations
@Override
rx.internal.operators back to summary

pack-priv final Class OnSubscribeFlatMapSingle.FlatMapSingleSubscriber.Requested

extends AtomicLong
implements Producer, Subscription
Class Inheritance
All Implemented Interfaces
rx.Subscription, rx.Producer

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.
pack-priv void
produced(long e)

public void
request(long
the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace
n
)

Implements rx.Producer.request.

Request a certain maximum number of items from this Producer.
public void
unsubscribe()

Implements rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.
Inherited from java.util.concurrent.atomic.AtomicLong:
accumulateAndGetaddAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetdecrementAndGetdoubleValuefloatValuegetgetAcquiregetAndAccumulategetAndAddgetAndDecrementgetAndIncrementgetAndSetgetAndUpdategetOpaquegetPlainincrementAndGetintValuelazySetlongValuesetsetOpaquesetPlainsetReleasetoStringupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicLong.serialVersionUID.

Constructor Detail

Requestedback to summary
pack-priv Requested()

Method Detail

isUnsubscribedback to summary
public boolean isUnsubscribed()

Implements rx.Subscription.isUnsubscribed.

Doc from rx.Subscription.isUnsubscribed.

Indicates whether this Subscription is currently unsubscribed.

Returns:boolean

true if this Subscription is currently unsubscribed, false otherwise

Annotations
@Override
producedback to summary
pack-priv void produced(long e)
requestback to summary
public void request(long n)

Implements rx.Producer.request.

Doc from rx.Producer.request.

Request a certain maximum number of items from this Producer. This is a way of requesting backpressure. To disable backpressure, pass Long.MAX_VALUE to this method.

Requests are additive but if a sequence of requests totals more than Long.MAX_VALUE then Long.MAX_VALUE requests will be actioned and the extras may be ignored. Arriving at Long.MAX_VALUE by addition of requests cannot be assumed to disable backpressure. For example, the code below may result in Long.MAX_VALUE requests being actioned only.

request(100);
request(Long.MAX_VALUE-1);
Parameters
n:long

the maximum number of items you want this Producer to produce, or Long.MAX_VALUE if you want the Producer to produce items at its own pace

Annotations
@Override
unsubscribeback to summary
public void unsubscribe()

Implements rx.Subscription.unsubscribe.

Doc from rx.Subscription.unsubscribe.

Stops the receipt of notifications on the Subscriber that was registered when this Subscription was received.

This allows deregistering an Subscriber before it has finished receiving all events (i.e. before onCompleted is called).

Annotations
@Override