Top Inners Fields Constructors Methods
io.reactivex.internal.operators.single

public final Class SingleCreate<T>

extends Single<T>
Class Inheritance
Imports
java.util.concurrent.atomic.AtomicReference, io.reactivex.*, io.reactivex.disposables.Disposable, io.reactivex.exceptions.Exceptions, io.reactivex.functions.Cancellable, io.reactivex.internal.disposables.*, io.reactivex.plugins.RxJavaPlugins

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final SingleOnSubscribe<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
subscribeActual(SingleObserver<? super T>
the SingleObserver to handle, not null
observer
)

Implements abstract io.reactivex.Single.subscribeActual.

Implement this method in subclasses to handle the incoming SingleObservers.
Inherited from io.reactivex.Single:
ambambArrayambWithasblockingGetcachecastcomposeconcatconcatconcatconcatconcatconcatconcatconcatArrayconcatArrayEagerconcatEagerconcatEagerconcatWithcontainscontainscreatedeferdelaydelaydelaydelaydelaySubscriptiondelaySubscriptiondelaySubscriptiondelaySubscriptiondelaySubscriptiondelaySubscriptiondematerializedoAfterSuccessdoAfterTerminatedoFinallydoOnDisposedoOnErrordoOnEventdoOnSubscribedoOnSuccessdoOnTerminateequalserrorerrorfilterflatMapflatMapCompletableflatMapMaybeflatMapObservableflatMapPublisherflattenAsFlowableflattenAsObservablefromCallablefromFuturefromFuturefromFuturefromFuturefromObservablefromPublisherhideignoreElementjustliftmapmaterializemergemergemergemergemergemergemergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeDelayErrormergeWithneverobserveOnonErrorResumeNextonErrorResumeNextonErrorReturnonErrorReturnItemonTerminateDetachrepeatrepeatrepeatUntilrepeatWhenretryretryretryretryretryretryWhensubscribesubscribesubscribesubscribesubscribesubscribeOnsubscribeWithtakeUntiltakeUntiltakeUntiltesttesttimeouttimeouttimeouttimeouttimertimertotoCompletabletoFlowabletoFuturetoMaybetoObservableunsafeCreateunsubscribeOnusingusingwrapzipzipzipzipzipzipzipzipzipzipArrayzipWith

Field Detail

sourceback to summary
pack-priv final SingleOnSubscribe<T> source

Constructor Detail

SingleCreateback to summary
public SingleCreate(SingleOnSubscribe<T> source)

Method Detail

subscribeActualback to summary
protected void subscribeActual(SingleObserver<? super T> observer)

Implements abstract io.reactivex.Single.subscribeActual.

Doc from io.reactivex.Single.subscribeActual.

Implement this method in subclasses to handle the incoming SingleObservers.

There is no need to call any of the plugin hooks on the current Single instance or the SingleObserver; all hooks and basic safeguards have been applied by subscribe(SingleObserver) before this method gets called.

Parameters
observer:SingleObserver<? super T>

the SingleObserver to handle, not null

Annotations
@Override
io.reactivex.internal.operators.single back to summary

pack-priv final Class SingleCreate.Emitter<T>

extends AtomicReference<Disposable>
implements SingleEmitter<T>, Disposable
Class Inheritance
All Implemented Interfaces
io.reactivex.disposables.Disposable, io.reactivex.SingleEmitter

Field Summary

Modifier and TypeField and Description
pack-priv final SingleObserver<? super T>
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
Emitter(SingleObserver<? super T> downstream)

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Implements io.reactivex.disposables.Disposable.dispose.

Dispose the resource, the operation should be idempotent.
public boolean
isDisposed()

Implements io.reactivex.SingleEmitter.isDisposed, io.reactivex.disposables.Disposable.isDisposed.

Returns true if the downstream disposed the sequence or the emitter was terminated via onSuccess(Object), onError(Throwable), or a successful tryOnError(Throwable).
public void
onError(Throwable
the exception, not null
t
)

Implements io.reactivex.SingleEmitter.onError.

Signal an exception.
public void
onSuccess(T
the value, not null
value
)

Implements io.reactivex.SingleEmitter.onSuccess.

Signal a success value.
public void
setCancellable(Cancellable
the cancellable resource, null is allowed
c
)

Implements io.reactivex.SingleEmitter.setCancellable.

Sets a Cancellable on this emitter; any previous Disposable or Cancellable will be disposed/cancelled.
public void
setDisposable(Disposable
the disposable, null is allowed
d
)

Implements io.reactivex.SingleEmitter.setDisposable.

Sets a Disposable on this emitter; any previous Disposable or Cancellable will be disposed/cancelled.
public String
toString()

Overrides java.util.concurrent.atomic.AtomicReference.toString.

Returns the String representation of the current value.
public boolean
tryOnError(Throwable
the throwable error to signal if possible
t
)

Implements io.reactivex.SingleEmitter.tryOnError.

Attempts to emit the specified Throwable error if the downstream hasn't cancelled the sequence or is otherwise terminated, returning false if the emission is not allowed to happen due to lifecycle restrictions.
Inherited from java.util.concurrent.atomic.AtomicReference:
accumulateAndGetcompareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetgetgetAcquiregetAndAccumulategetAndSetgetAndUpdategetOpaquegetPlainlazySetsetsetOpaquesetPlainsetReleaseupdateAndGetweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

downstreamback to summary
pack-priv final SingleObserver<? super T> downstream
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.concurrent.atomic.AtomicReference.serialVersionUID.

Constructor Detail

Emitterback to summary
pack-priv Emitter(SingleObserver<? super T> downstream)

Method Detail

disposeback to summary
public void dispose()

Implements io.reactivex.disposables.Disposable.dispose.

Doc from io.reactivex.disposables.Disposable.dispose.

Dispose the resource, the operation should be idempotent.

Annotations
@Override
isDisposedback to summary
public boolean isDisposed()

Implements io.reactivex.SingleEmitter.isDisposed, io.reactivex.disposables.Disposable.isDisposed.

Doc from io.reactivex.SingleEmitter.isDisposed.

Returns true if the downstream disposed the sequence or the emitter was terminated via onSuccess(Object), onError(Throwable), or a successful tryOnError(Throwable).

This method is thread-safe.

Returns:boolean

true if the downstream disposed the sequence or the emitter was terminated

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

Implements io.reactivex.SingleEmitter.onError.

Doc from io.reactivex.SingleEmitter.onError.

Signal an exception.

Parameters
t:Throwable

the exception, not null

Annotations
@Override
onSuccessback to summary
public void onSuccess(T value)

Implements io.reactivex.SingleEmitter.onSuccess.

Doc from io.reactivex.SingleEmitter.onSuccess.

Signal a success value.

Parameters
value:T

the value, not null

Annotations
@Override
setCancellableback to summary
public void setCancellable(Cancellable c)

Implements io.reactivex.SingleEmitter.setCancellable.

Doc from io.reactivex.SingleEmitter.setCancellable.

Sets a Cancellable on this emitter; any previous Disposable or Cancellable will be disposed/cancelled.

Parameters
c:Cancellable

the cancellable resource, null is allowed

Annotations
@Override
setDisposableback to summary
public void setDisposable(Disposable d)

Implements io.reactivex.SingleEmitter.setDisposable.

Doc from io.reactivex.SingleEmitter.setDisposable.

Sets a Disposable on this emitter; any previous Disposable or Cancellable will be disposed/cancelled.

Parameters
d:Disposable

the disposable, null is allowed

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.util.concurrent.atomic.AtomicReference.toString.

Doc from java.util.concurrent.atomic.AtomicReference.toString.

Returns the String representation of the current value.

Returns:String

the String representation of the current value

Annotations
@Override
tryOnErrorback to summary
public boolean tryOnError(Throwable t)

Implements io.reactivex.SingleEmitter.tryOnError.

Doc from io.reactivex.SingleEmitter.tryOnError.

Attempts to emit the specified Throwable error if the downstream hasn't cancelled the sequence or is otherwise terminated, returning false if the emission is not allowed to happen due to lifecycle restrictions.

Unlike onError(Throwable), the RxJavaPlugins.onError is not called if the error could not be delivered.

History: 2.1.1 - experimental

Parameters
t:Throwable

the throwable error to signal if possible

Returns:boolean

true if successful, false if the downstream is not able to accept further events

Annotations
@Override