T
- the value typepublic abstract class Solo<T> extends Object implements Publisher<T>
Constructor and Description |
---|
Solo() |
Modifier and Type | Method and Description |
---|---|
static <T> Solo<T> |
amb(Iterable<? extends Solo<? extends T>> sources)
Emit the events of the Solo that reacts first.
|
static <T> Solo<T> |
ambArray(Solo<? extends T>... sources)
Emit the events of the Solo that reacts first.
|
Solo<T> |
ambWith(Solo<? extends T> other)
Signal the events of this or the other Solo whichever
signals first.
|
Solo<T> |
andThen(Nono other)
Run the given Nono after this Solo completes successfully and
emit that original success value only if the Nono completes normally.
|
Flowable<T> |
andThen(Publisher<? extends T> other)
Emits the success value of this Solo and then continues with
the events of the other Publisher.
|
T |
blockingGet()
Blockingly awaits indefinitely the success value of this Solo or rethrows
its error (wrapped into a RuntimeException if necessary).
|
T |
blockingGet(long timeout,
TimeUnit unit)
Blockingly awaits at most the given timeout for the success
value of this Solo or rethrows
its error (wrapped into a RuntimeException if necessary).
|
void |
blockingSubscribe()
Blocks until this Solo terminates and ignores the signals it produced.
|
void |
blockingSubscribe(Consumer<? super T> onNext)
Blocks until this Solo terminates and calls the onNext with the success value.
|
void |
blockingSubscribe(Consumer<? super T> onNext,
Consumer<? super Throwable> onError)
Blocks until this solo terminates and calls the onNext with the success value
or calls the onError with the error Throwable.
|
void |
blockingSubscribe(Consumer<? super T> onNext,
Consumer<? super Throwable> onError,
Action onComplete)
Blocks until this Solo produces its terminal signal and calls the
appropriate callback(s) based on the signal type.
|
Solo<T> |
cache()
Caches the value or error event of the upstream Solo
and relays/replays it to Subscribers.
|
<R> Solo<R> |
compose(Function<? super Solo<T>,? extends Solo<R>> composer)
Applies a function to this Solo and returns the Solo it returned.
|
static <T> Flowable<T> |
concat(Iterable<? extends Solo<? extends T>> sources)
Concatenate the values in order from a sequence of Solo sources.
|
static <T> Flowable<T> |
concat(Publisher<? extends Solo<? extends T>> sources)
Concatenate the values in order from a sequence of Solo sources.
|
static <T> Flowable<T> |
concat(Publisher<? extends Solo<? extends T>> sources,
int prefetch)
Concatenate the values in order from a sequence of Solo sources.
|
static <T> Flowable<T> |
concatArray(Solo<? extends T>... sources)
Concatenate the values in order from a sequence of Solo sources.
|
static <T> Flowable<T> |
concatArrayDelayError(Solo<? extends T>... sources)
Concatenate the values in order from a sequence of Solo sources, delaying
errors till all sources terminate.
|
static <T> Flowable<T> |
concatDelayError(Iterable<? extends Solo<? extends T>> sources)
Concatenate the values in order from a sequence of Solo sources, delaying
errors till all sources terminate.
|
static <T> Flowable<T> |
concatDelayError(Publisher<? extends Solo<? extends T>> sources)
Concatenate the values in order from a sequence of Solo sources, delaying
errors till all sources terminate.
|
static <T> Flowable<T> |
concatDelayError(Publisher<? extends Solo<? extends T>> sources,
int prefetch)
Concatenate the values in order from a sequence of Solo sources, delaying
errors till all sources terminate.
|
static <T> Flowable<T> |
concatDelayError(Publisher<? extends Solo<? extends T>> sources,
int prefetch,
boolean tillTheEnd)
Concatenate the values in order from a sequence of Solo sources, delaying
errors till a source terminates or the whole sequence terminates.
|
Flowable<T> |
concatWith(Solo<T> other)
Emits the success value of this Solo followed by the event of
the other Solo.
|
static <T> Solo<T> |
create(SingleOnSubscribe<T> onCreate)
Create a Solo that for each incoming Subscriber calls a callback to
emit a sync or async events in a thread-safe, backpressure-aware and
cancellation-safe manner.
|
static <T> Solo<T> |
defer(Supplier<? extends Solo<T>> supplier)
Defers the creation of the actual Solo to the time when a Subscriber
subscribes to the returned Solo.
|
Solo<T> |
delay(long delay,
TimeUnit unit)
Delay the emission of the signal of this Solo with the specified
time amount.
|
Solo<T> |
delay(long delay,
TimeUnit unit,
Scheduler scheduler)
Delay the emission of the signal of this Solo with the specified
time amount on the specified scheduler.
|
Solo<T> |
delay(Publisher<?> other)
Delay the emission of the signal until the other Publisher signals
an item or completes.
|
Solo<T> |
delaySubscription(long delay,
TimeUnit unit)
Delay the subscription to this Solo until the specified delay elapses.
|
Solo<T> |
delaySubscription(long delay,
TimeUnit unit,
Scheduler scheduler)
Delay the subscription to this Solo until the specified delay elapses.
|
Solo<T> |
delaySubscription(Publisher<?> other)
Delay the subscription to this Solo until the other Publisher
signals a value or completes.
|
Solo<T> |
doAfterNext(Consumer<? super T> onAfterNext)
Executes a callback after the value is emitted to downstream.
|
Solo<T> |
doAfterTerminate(Action onAfterTerminate)
Executes the callback after this Solo terminates and the downstream
is notified.
|
Solo<T> |
doFinally(Action onFinally)
Executes the callback exactly if the upstream terminates or
the downstream cancels the sequence.
|
Solo<T> |
doOnCancel(Action onCancel)
Executes the callback if the downstream cancels the sequence.
|
Solo<T> |
doOnComplete(Action onComplete)
Executes a callback when the upstream completes normally.
|
Solo<T> |
doOnError(Consumer<? super Throwable> onError)
Executes a callback when the upstream signals an error.
|
Solo<T> |
doOnNext(Consumer<? super T> onNext)
Executes a callback before the value is emitted to downstream.
|
Solo<T> |
doOnRequest(LongConsumer onRequest)
Executes the callback when the downstream requests from this Solo.
|
Solo<T> |
doOnSubscribe(Consumer<? super Subscription> onSubscribe)
Executes a callback when the upstream calls onSubscribe.
|
static <T> Solo<T> |
error(Supplier<? extends Throwable> errorSupplier)
Returns a Solo that signals the error returned from
the errorSupplier to each individual Subscriber.
|
static <T> Solo<T> |
error(Throwable error)
Returns a Solo that signals the given error to Subscribers.
|
Perhaps<T> |
filter(Predicate<? super T> predicate)
Applies a predicate to the value and emits it if the predicate
returns true, completes otherwise.
|
<R> Solo<R> |
flatMap(Function<? super T,? extends Solo<? extends R>> mapper)
Maps the success value of this Solo into another Solo and
emits its signals.
|
<R> Solo<R> |
flatMap(Function<? super T,? extends Solo<? extends R>> onSuccessMapper,
Function<? super Throwable,? extends Solo<? extends R>> onErrorMapper)
Maps the success value or the failure of this Solo into another
Solo and emits its signal.
|
<R> Flowable<R> |
flatMapPublisher(Function<? super T,? extends Publisher<? extends R>> mapper)
Maps the success value of this Solo into a Publisher and
emits its signals.
|
static <T> Solo<T> |
fromCallable(Callable<T> callable)
Returns a Solo that calls the callable and emits its value or error.
|
static <T> Solo<T> |
fromFuture(Future<? extends T> future)
When subscribed, the future is awaited blockingly and
indefinitely for its result value; null result
will yield a NoSuchElementException.
|
static <T> Solo<T> |
fromFuture(Future<? extends T> future,
long timeout,
TimeUnit unit)
When subscribed, the future is awaited blockingly for
a given amount of time for its result value; null result
will yield a NoSuchElementException and a timeout
will yield a TimeoutException.
|
static <T> Solo<T> |
fromPublisher(Publisher<T> source)
Wraps a Publisher into a Solo and signals its only value,
NoSuchElementException if empty or IndexOutOfBoundsException if it has
more than one element.
|
static <T> Solo<T> |
fromSingle(SingleSource<T> source)
Wraps a Single into a Solo and signals its events.
|
static <T> Function<Solo<T>,Solo<T>> |
getOnAssemblyHandler()
Returns the current onAssembly handler.
|
Solo<T> |
hide()
Hides the identity of this Solo, including its Subscription and
allows preventing fusion and other optimizations for diagnostic
purposes.
|
Nono |
ignoreElement()
Ignore the solo value of this Solo and only signal the terminal events.
|
static <T> Solo<T> |
just(T item)
Returns a Solo that signals the given item and completes.
|
<R> Solo<R> |
lift(Function<Subscriber<? super R>,Subscriber<? super T>> onLift)
Map the downstream Subscriber into an upstream Subscriber.
|
<R> Solo<R> |
map(Function<? super T,? extends R> mapper)
Maps the value of this Solo into another value via function.
|
Solo<T> |
mapError(Function<? super Throwable,? extends Throwable> errorMapper)
Maps the Throwable error of this Solo into another Throwable error type.
|
static <T> Flowable<T> |
merge(Iterable<? extends Solo<? extends T>> sources)
Merge the values in arbitrary order from a sequence of Solo sources.
|
static <T> Flowable<T> |
merge(Iterable<? extends Solo<? extends T>> sources,
int maxConcurrency)
Merge the values in arbitrary order from a sequence of Solo sources.
|
static <T> Flowable<T> |
merge(Publisher<? extends Solo<? extends T>> sources)
Merge the values in arbitrary order from a sequence of Solo sources.
|
static <T> Flowable<T> |
merge(Publisher<? extends Solo<? extends T>> sources,
int maxConcurrency)
Merge the values in arbitrary order from a sequence of Solo sources.
|
static <T> Flowable<T> |
mergeArray(int maxConcurrency,
Solo<? extends T>... sources)
Merge the values in arbitrary order from a sequence of Solo sources.
|
static <T> Flowable<T> |
mergeArray(Solo<? extends T>... sources)
Merge the values in arbitrary order from a sequence of Solo sources.
|
static <T> Flowable<T> |
mergeArrayDelayError(int maxConcurrency,
Solo<? extends T>... sources)
Merge the values in arbitrary order from a sequence of Solo sources,
delaying errors till all sources terminate.
|
static <T> Flowable<T> |
mergeArrayDelayError(Solo<? extends T>... sources)
Merge the values in arbitrary order from a sequence of Solo sources,
delaying errors till all sources terminate.
|
static <T> Flowable<T> |
mergeDelayError(Iterable<? extends Solo<? extends T>> sources)
Merge the values in arbitrary order from a sequence of Solo sources,
delaying errors till all sources terminate.
|
static <T> Flowable<T> |
mergeDelayError(Iterable<? extends Solo<? extends T>> sources,
int maxConcurrency)
Merge the values in arbitrary order from a sequence of Solo sources,
delaying errors till all sources terminate.
|
static <T> Flowable<T> |
mergeDelayError(Publisher<? extends Solo<? extends T>> sources)
Merge the values in arbitrary order from a sequence of Solo sources,
delaying errors till all sources terminate.
|
static <T> Flowable<T> |
mergeDelayError(Publisher<? extends Solo<? extends T>> sources,
int maxConcurrency)
Merge the values in arbitrary order from a sequence of Solo sources,
delaying errors till all sources terminate.
|
Flowable<T> |
mergeWith(Solo<T> other)
Merges the values of this Solo and the other Solo into a
Flowable sequence.
|
static <T> Solo<T> |
never()
Returns a Solo that never signals an item or terminal event.
|
Solo<T> |
observeOn(Scheduler scheduler)
Returns a Solo that delivers the onNext, onError and onComplete signals
from this Solo on the specified scheduler.
|
protected static <T> Solo<T> |
onAssembly(Solo<T> source) |
Solo<T> |
onErrorResumeNext(Function<? super Throwable,? extends Solo<T>> errorHandler)
If the upstream signals an error, call a function and subscribe to
the Solo it returns.
|
Solo<T> |
onErrorResumeWith(Solo<T> next)
If the upstream signals an error, switch over to the next Solo
and emits its signal instead.
|
Solo<T> |
onErrorReturnItem(T item)
If the upstream signals an error, signal an item instead.
|
Flowable<T> |
repeat()
Repeats this Solo indefinitely.
|
Flowable<T> |
repeat(BooleanSupplier stop)
Repeats this Solo until the given boolean supplier returns true when an
repeat iteration of this Solo completes.
|
Flowable<T> |
repeat(long times)
Repeats this Solo at most the given number of times.
|
Flowable<T> |
repeatWhen(Function<? super Flowable<Object>,? extends Publisher<?>> handler)
Repeats this Solo when the Publisher returned by the handler function emits
an item or terminates if this Publisher terminates.
|
Solo<T> |
retry()
Retry this Solo indefinitely if it fails.
|
Solo<T> |
retry(long times)
Retry this Solo at most the given number of times if it fails.
|
Solo<T> |
retry(Predicate<? super Throwable> predicate)
Retry this Solo if the predicate returns true for the latest failure
Throwable.
|
Solo<T> |
retryWhen(Function<? super Flowable<Throwable>,? extends Publisher<?>> handler)
Retry this solo if the Publisher returned by the handler signals an item
in response to the failure Throwable.
|
static <T> void |
setOnAssemblyHandler(Function<Solo<T>,Solo<T>> handler)
Set the onAssembly handler.
|
Disposable |
subscribe()
Subscribe to this Solo and ignore any signal it produces.
|
Disposable |
subscribe(Consumer<? super T> onNext)
Subscribes to this Solo and calls the onNext if this Solo succeeds.
|
Disposable |
subscribe(Consumer<? super T> onNext,
Consumer<? super Throwable> onError)
Subscribes to this Solo and calls the appropriate callback for the resulting signal.
|
Disposable |
subscribe(Consumer<? super T> onNext,
Consumer<? super Throwable> onError,
Action onComplete)
Subscribes to this Solo and calls the appropriate callback for the resulting signal.
|
void |
subscribe(Subscriber<? super T> s) |
protected abstract void |
subscribeActual(Subscriber<? super T> s)
Implement this method to react to a Subscriber subscribing to this Solo.
|
Solo<T> |
subscribeOn(Scheduler scheduler)
Returns a Solo that subscribes to this Solo on the specified scheduler
and makes sure downstream requests are forwarded there as well.
|
<E extends Subscriber<? super T>> |
subscribeWith(E s)
Subscribe with a Subscriber (subclass) and return it as is.
|
Solo<T> |
takeUntil(Publisher<?> other)
Signal a NoSuchElementException if the other signals before this
Solo signals.
|
TestSubscriber<T> |
test()
Creates a TestSubscriber and subscribes it to this Solo.
|
TestSubscriber<T> |
test(boolean cancel)
Creates a TestSubscriber, optionally cancels it, and subscribes
it to this Solo.
|
TestSubscriber<T> |
test(long initialRequest)
Creates a TestSubscriber with the given initial request and
subscribes it to this Solo.
|
TestSubscriber<T> |
test(long initialRequest,
boolean cancel)
Creates a TestSubscriber with the given initial request,
optionally cancels it, and subscribes it to this Solo.
|
Solo<T> |
timeout(long timeout,
TimeUnit unit)
Signal a TimeoutException if there is no item from this Solo within
the given timeout time.
|
Solo<T> |
timeout(long timeout,
TimeUnit unit,
Scheduler scheduler)
Signal a TimeoutException if there is no item from this Solo within
the given timeout time, running on the specified scheduler.
|
Solo<T> |
timeout(long timeout,
TimeUnit unit,
Scheduler scheduler,
Solo<T> fallback)
Fall back to another Solo if this Solo doesn't signal within the given
time period, waiting on the specified scheduler.
|
Solo<T> |
timeout(long timeout,
TimeUnit unit,
Solo<T> fallback)
Fall back to another Solo if this Solo doesn't signal within the given
time period.
|
Solo<T> |
timeout(Publisher<?> other)
Signal a TimeoutException if the other Publisher signals or completes
before this Solo signals a value.
|
Solo<T> |
timeout(Publisher<?> other,
Solo<T> fallback)
Fall back to another Solo if the other Publisher signals or completes
before this Solo signals a value.
|
static Solo<Long> |
timer(long delay,
TimeUnit unit)
Signals a 0L after the specified amount of time has passed since
subscription.
|
static Solo<Long> |
timer(long delay,
TimeUnit unit,
Scheduler scheduler)
Signals a 0L after the specified amount of time has passed since
subscription on the specified scheduler.
|
<R> R |
to(Function<? super Solo<T>,R> converter)
Applies the function, fluently to this Solo and returns the value it returns.
|
Flowable<T> |
toFlowable()
Converts this Solo into a Flowable.
|
Future<T> |
toFuture()
Converts this Solo into a Future and signals its single
value.
|
Observable<T> |
toObservable()
Converts this Solo into an Observable.
|
Single<T> |
toSingle()
Converts this Soli into a Single.
|
Solo<T> |
unsubscribeOn(Scheduler scheduler)
Returns a Solo which when cancelled, cancels this Solo on the
specified scheduler.
|
static <T,R> Solo<T> |
using(Supplier<R> resourceSupplier,
Function<? super R,? extends Solo<T>> sourceSupplier,
Consumer<? super R> disposer)
Generate a resource and a Solo based on that resource and then
dispose that resource eagerly when the Solo terminates or the
downstream cancels the sequence.
|
static <T,R> Solo<T> |
using(Supplier<R> resourceSupplier,
Function<? super R,? extends Solo<T>> sourceSupplier,
Consumer<? super R> disposer,
boolean eager)
Generate a resource and a Solo based on that resource and then
dispose that resource eagerly when the Solo terminates or the
downstream cancels the sequence.
|
static <T,R> Solo<R> |
zip(Iterable<? extends Solo<? extends T>> sources,
Function<? super Object[],? extends R> zipper)
Combines the solo values of all the sources via a zipper function into a
single resulting value.
|
static <T,R> Solo<R> |
zipArray(Function<? super Object[],? extends R> zipper,
Solo<? extends T>... sources)
Combines the solo values of all the sources via a zipper function into a
single resulting value.
|
<U,R> Solo<R> |
zipWith(Solo<U> other,
BiFunction<? super T,? super U,? extends R> zipper)
Combines the values of this and the other Solo via a BiFunction.
|
public static <T> Function<Solo<T>,Solo<T>> getOnAssemblyHandler()
T
- the target value typepublic static <T> void setOnAssemblyHandler(Function<Solo<T>,Solo<T>> handler)
T
- the target value typehandler
- the handler, null clears the handlerpublic static <T> Solo<T> create(SingleOnSubscribe<T> onCreate)
T
- the value type emittedonCreate
- the callback called for each individual subscriber with an
abstraction of the incoming Subscriber.public static <T> Solo<T> just(T item)
T
- the value typeitem
- the item, not nullpublic static <T> Solo<T> error(Throwable error)
T
- the value typeerror
- the error to signal, not nullpublic static <T> Solo<T> error(Supplier<? extends Throwable> errorSupplier)
T
- the value typeerrorSupplier
- the supplier called for each Subscriber to
return a Throwable to be signalledpublic static <T> Solo<T> fromCallable(Callable<T> callable)
T
- the value typecallable
- the callable to callpublic static <T> Solo<T> never()
T
- the value typepublic static <T> Solo<T> defer(Supplier<? extends Solo<T>> supplier)
T
- the value typesupplier
- the supplier of the actual Solopublic static <T> Solo<T> fromPublisher(Publisher<T> source)
T
- the value typesource
- the source Publisherpublic static <T> Solo<T> fromSingle(SingleSource<T> source)
T
- the value typesource
- the source Singlepublic static <T> Solo<T> fromFuture(Future<? extends T> future)
T
- the value typefuture
- the future to awaitpublic static <T> Solo<T> fromFuture(Future<? extends T> future, long timeout, TimeUnit unit)
T
- the value typefuture
- the future to awaittimeout
- the timeout valueunit
- the time unitpublic static <T> Solo<T> amb(Iterable<? extends Solo<? extends T>> sources)
T
- the common value typesources
- the Iterable sequence of Solo sources@SafeVarargs public static <T> Solo<T> ambArray(Solo<? extends T>... sources)
T
- the common value typesources
- the array of Solo sourcespublic static <T> Flowable<T> concat(Iterable<? extends Solo<? extends T>> sources)
T
- the common base value typesources
- the sequence of sourcespublic static <T> Flowable<T> concat(Publisher<? extends Solo<? extends T>> sources)
T
- the common base value typesources
- the sequence of sourcespublic static <T> Flowable<T> concat(Publisher<? extends Solo<? extends T>> sources, int prefetch)
T
- the common base value typesources
- the sequence of sourcesprefetch
- the number of sources to prefetch from upstream@SafeVarargs public static <T> Flowable<T> concatArray(Solo<? extends T>... sources)
T
- the common base value typesources
- the sequence of sourcespublic static <T> Flowable<T> concatDelayError(Iterable<? extends Solo<? extends T>> sources)
T
- the common base value typesources
- the sequence of sourcespublic static <T> Flowable<T> concatDelayError(Publisher<? extends Solo<? extends T>> sources)
T
- the common base value typesources
- the sequence of sourcespublic static <T> Flowable<T> concatDelayError(Publisher<? extends Solo<? extends T>> sources, int prefetch)
T
- the common base value typesources
- the sequence of sourcesprefetch
- the number of sources to prefetch from upstreampublic static <T> Flowable<T> concatDelayError(Publisher<? extends Solo<? extends T>> sources, int prefetch, boolean tillTheEnd)
T
- the common base value typesources
- the sequence of sourcesprefetch
- the number of sources to prefetch from upstreamtillTheEnd
- if true, errors are delayed to the very end;
if false, an error will be signalled at the end of one source@SafeVarargs public static <T> Flowable<T> concatArrayDelayError(Solo<? extends T>... sources)
T
- the common base value typesources
- the sequence of sourcespublic static <T> Flowable<T> merge(Iterable<? extends Solo<? extends T>> sources)
T
- the common base value typesources
- the sequence of sourcespublic static <T> Flowable<T> merge(Iterable<? extends Solo<? extends T>> sources, int maxConcurrency)
T
- the common base value typesources
- the sequence of sourcesmaxConcurrency
- the maximum number of active subscriptionspublic static <T> Flowable<T> merge(Publisher<? extends Solo<? extends T>> sources)
T
- the common base value typesources
- the sequence of sourcespublic static <T> Flowable<T> merge(Publisher<? extends Solo<? extends T>> sources, int maxConcurrency)
T
- the common base value typesources
- the sequence of sourcesmaxConcurrency
- the maximum number of active subscriptions@SafeVarargs public static <T> Flowable<T> mergeArray(Solo<? extends T>... sources)
T
- the common base value typesources
- the sequence of sources@SafeVarargs public static <T> Flowable<T> mergeArray(int maxConcurrency, Solo<? extends T>... sources)
T
- the common base value typesources
- the sequence of sourcesmaxConcurrency
- the maximum number of active subscriptionspublic static <T> Flowable<T> mergeDelayError(Iterable<? extends Solo<? extends T>> sources)
T
- the common base value typesources
- the sequence of sourcespublic static <T> Flowable<T> mergeDelayError(Iterable<? extends Solo<? extends T>> sources, int maxConcurrency)
T
- the common base value typesources
- the sequence of sourcesmaxConcurrency
- the maximum number of active subscriptionspublic static <T> Flowable<T> mergeDelayError(Publisher<? extends Solo<? extends T>> sources)
T
- the common base value typesources
- the sequence of sourcespublic static <T> Flowable<T> mergeDelayError(Publisher<? extends Solo<? extends T>> sources, int maxConcurrency)
T
- the common base value typesources
- the sequence of sourcesmaxConcurrency
- the maximum number of active subscriptions@SafeVarargs public static <T> Flowable<T> mergeArrayDelayError(Solo<? extends T>... sources)
T
- the common base value typesources
- the sequence of sources@SafeVarargs public static <T> Flowable<T> mergeArrayDelayError(int maxConcurrency, Solo<? extends T>... sources)
T
- the common base value typesources
- the sequence of sourcesmaxConcurrency
- the maximum number of active subscriptionspublic static Solo<Long> timer(long delay, TimeUnit unit)
delay
- the delay timeunit
- the time unitpublic static Solo<Long> timer(long delay, TimeUnit unit, Scheduler scheduler)
delay
- the delay timeunit
- the time unitscheduler
- the scheduler to wait onpublic static <T,R> Solo<T> using(Supplier<R> resourceSupplier, Function<? super R,? extends Solo<T>> sourceSupplier, Consumer<? super R> disposer)
T
- the value typeR
- the resource typeresourceSupplier
- the callback to get a resource for each subscribersourceSupplier
- the function that returns a Solo for the generated resourcedisposer
- the consumer of the resource once the upstream terminates or the
downstream cancelspublic static <T,R> Solo<T> using(Supplier<R> resourceSupplier, Function<? super R,? extends Solo<T>> sourceSupplier, Consumer<? super R> disposer, boolean eager)
T
- the value typeR
- the resource typeresourceSupplier
- the callback to get a resource for each subscribersourceSupplier
- the function that returns a Solo for the generated resourcedisposer
- the consumer of the resource once the upstream terminates or the
downstream cancelseager
- if true, the resource is disposed before the terminal event is emitted
if false, the resource is disposed after the terminal event has been emittedpublic static <T,R> Solo<R> zip(Iterable<? extends Solo<? extends T>> sources, Function<? super Object[],? extends R> zipper)
T
- the common input base typeR
- the result typesources
- the sequence of Solo sourceszipper
- the function takin in an array of values and returns a solo value@SafeVarargs public static <T,R> Solo<R> zipArray(Function<? super Object[],? extends R> zipper, Solo<? extends T>... sources)
T
- the common input base typeR
- the result typesources
- the sequence of Solo sourceszipper
- the function takin in an array of values and returns a solo valuepublic final Solo<T> ambWith(Solo<? extends T> other)
other
- the other Solopublic final Solo<T> andThen(Nono other)
other
- the other Nono to executepublic final Flowable<T> andThen(Publisher<? extends T> other)
other
- the other Publisher instancepublic final Flowable<T> concatWith(Solo<T> other)
other
- the other Solo instancepublic final Flowable<T> mergeWith(Solo<T> other)
other
- the other Solo instancepublic final <U,R> Solo<R> zipWith(Solo<U> other, BiFunction<? super T,? super U,? extends R> zipper)
U
- the other value typeR
- the result value typeother
- the other Solo sourcezipper
- the bi-function taking the success value from this and
the other Solo and returns a solo value to be emitted.public final <R> Solo<R> map(Function<? super T,? extends R> mapper)
R
- the output value typemapper
- the function that receives the success value of this Solo
and returns a replacement value.public final Solo<T> mapError(Function<? super Throwable,? extends Throwable> errorMapper)
errorMapper
- the function that receives the Throwable and should
return a Throwable to be emitted.public final Perhaps<T> filter(Predicate<? super T> predicate)
predicate
- the predicate called with the solo valuepublic final Solo<T> timeout(long timeout, TimeUnit unit)
timeout
- the timeout valueunit
- the time unitpublic final Solo<T> timeout(long timeout, TimeUnit unit, Scheduler scheduler)
timeout
- the timeout valueunit
- the time unitscheduler
- the scheduler to wait onpublic final Solo<T> timeout(long timeout, TimeUnit unit, Solo<T> fallback)
timeout
- the timeout valueunit
- the time unitfallback
- the other Solo to subscribe topublic final Solo<T> timeout(long timeout, TimeUnit unit, Scheduler scheduler, Solo<T> fallback)
timeout
- the timeout valueunit
- the time unitscheduler
- the scheduler to wait onfallback
- the fallback Solo to subscribe topublic final Solo<T> timeout(Publisher<?> other)
other
- the other Publisher triggers the TimeoutException when
it signals its first item or completes.public final Solo<T> timeout(Publisher<?> other, Solo<T> fallback)
other
- the other Publisher triggers the TimeoutException when
it signals its first item or completes.fallback
- the fallback Solo to subscribe to in case of a timeoutpublic final Solo<T> onErrorReturnItem(T item)
item
- the item to signal if the upstream failspublic final Solo<T> onErrorResumeWith(Solo<T> next)
next
- the other Solo to switch to in case of an upstream errorpublic final Solo<T> onErrorResumeNext(Function<? super Throwable,? extends Solo<T>> errorHandler)
errorHandler
- the function receiving the upstream error and
returns a Solo to resume with.public final <R> Solo<R> flatMap(Function<? super T,? extends Solo<? extends R>> mapper)
R
- the result typemapper
- the function that receives the success value and returns
another Solo to subscribe topublic final <R> Solo<R> flatMap(Function<? super T,? extends Solo<? extends R>> onSuccessMapper, Function<? super Throwable,? extends Solo<? extends R>> onErrorMapper)
R
- the result typeonSuccessMapper
- the function that receives the success value and return
another Solo to subscribe toonErrorMapper
- the function that receives the Throwable error and
return another Solo to subscribe topublic final <R> Flowable<R> flatMapPublisher(Function<? super T,? extends Publisher<? extends R>> mapper)
R
- the result typemapper
- the function that takes the success value of this Solo
and returns a Publisherpublic final Solo<T> takeUntil(Publisher<?> other)
other
- the other Publisherpublic final Solo<T> delay(long delay, TimeUnit unit)
delay
- the delay timeunit
- the delay time unitpublic final Solo<T> delay(long delay, TimeUnit unit, Scheduler scheduler)
delay
- the delay timeunit
- the delay time unitscheduler
- the scheduler to wait onpublic final Solo<T> delay(Publisher<?> other)
other
- the other Publisher that has to signal to emit the origina
signal from this Solopublic final Solo<T> delaySubscription(Publisher<?> other)
other
- the other Publisher to trigger the actual subscriptionpublic final Solo<T> delaySubscription(long delay, TimeUnit unit)
delay
- the delay timeunit
- the delay unitpublic final Solo<T> delaySubscription(long delay, TimeUnit unit, Scheduler scheduler)
delay
- the delay timeunit
- the delay unitscheduler
- the scheduler to wait onpublic final Flowable<T> toFlowable()
public final Observable<T> toObservable()
public final Single<T> toSingle()
public final Solo<T> doOnSubscribe(Consumer<? super Subscription> onSubscribe)
onSubscribe
- the consumer called with the upstream Subscriptionpublic final Solo<T> doOnRequest(LongConsumer onRequest)
onRequest
- the callback called with the request amountpublic final Solo<T> doOnCancel(Action onCancel)
onCancel
- the action to callpublic final Solo<T> doOnNext(Consumer<? super T> onNext)
onNext
- the consumer called with the current value before it is
is emitted to downstream.public final Solo<T> doAfterNext(Consumer<? super T> onAfterNext)
onAfterNext
- the consumer called with the current value after it is
is emitted to downstream.public final Solo<T> doOnError(Consumer<? super Throwable> onError)
onError
- the consumer called before the error is emitted to
the downstreampublic final Solo<T> doOnComplete(Action onComplete)
onComplete
- the consumer called before the completion event
is emitted to the downstream.public final Solo<T> doAfterTerminate(Action onAfterTerminate)
onAfterTerminate
- the callback to call after the downstream is notifiedpublic final Solo<T> doFinally(Action onFinally)
onFinally
- the action to callpublic final Nono ignoreElement()
public final Solo<T> hide()
public final <R> R to(Function<? super Solo<T>,R> converter)
R
- the result typeconverter
- the function receiving this Solo and returns a value to be returnedpublic final <R> Solo<R> compose(Function<? super Solo<T>,? extends Solo<R>> composer)
R
- the result typecomposer
- the function that receives this Solo and should return a Solopublic final <R> Solo<R> lift(Function<Subscriber<? super R>,Subscriber<? super T>> onLift)
R
- the downstream value typeonLift
- the function called with the downstream's Subscriber and
should return a Subscriber to be subscribed to this Solo.public final Flowable<T> repeat()
public final Flowable<T> repeat(long times)
times
- the number of times to repeatpublic final Flowable<T> repeat(BooleanSupplier stop)
stop
- the supplier of a boolean value that should return true to
stop repeating.public final Flowable<T> repeatWhen(Function<? super Flowable<Object>,? extends Publisher<?>> handler)
handler
- the function that receives Flowable that emits an item
when this Solo completes and returns a Publisher that should emit an item
to trigger a repeat or terminate to trigger a termination.public final Solo<T> retry()
public final Solo<T> retry(long times)
times
- the number of times, Long.MAX_VALUE means indefinitelypublic final Solo<T> retry(Predicate<? super Throwable> predicate)
predicate
- the predicate receiving the latest Throwable and
if returns true, the Solo is retried.public final Solo<T> retryWhen(Function<? super Flowable<Throwable>,? extends Publisher<?>> handler)
handler
- the function that receives a Flowable that signals the
failure Throwable of this Solo and returns a Publisher which triggers a retry
or termination.public final Solo<T> subscribeOn(Scheduler scheduler)
scheduler
- the scheduler to subscribe onpublic final Solo<T> observeOn(Scheduler scheduler)
scheduler
- the scheduler to emit the events onpublic final Solo<T> unsubscribeOn(Scheduler scheduler)
scheduler
- the scheduler to cancel this Solopublic final Solo<T> cache()
public final void subscribe(Subscriber<? super T> s)
protected abstract void subscribeActual(Subscriber<? super T> s)
s
- the downstream Subscriber, never nullpublic final <E extends Subscriber<? super T>> E subscribeWith(E s)
E
- the Subscriber subclass types
- the soubscriber, not nulls
as ispublic final Disposable subscribe()
public final Disposable subscribe(Consumer<? super T> onNext)
onNext
- called when this Solo succeedspublic final Disposable subscribe(Consumer<? super T> onNext, Consumer<? super Throwable> onError)
onNext
- called when this Solo succeedsonError
- called when this Solo failspublic final Disposable subscribe(Consumer<? super T> onNext, Consumer<? super Throwable> onError, Action onComplete)
onNext
- called when this Solo succeedsonError
- called when this Solo failsonComplete
- called when this Solo succeeds after the call to onNextpublic final void blockingSubscribe()
public final void blockingSubscribe(Consumer<? super T> onNext)
onNext
- the callback to call when this Solo completes with a success valuepublic final void blockingSubscribe(Consumer<? super T> onNext, Consumer<? super Throwable> onError)
onNext
- the callback to call when this Solo completes with a success valueonError
- the callback to call when this Solo fails with an errorpublic final void blockingSubscribe(Consumer<? super T> onNext, Consumer<? super Throwable> onError, Action onComplete)
onNext
- called when the Solo succeedsonError
- called when the Solo failsonComplete
- called when the Solo succeeds after the call to onNext.public final T blockingGet()
public final T blockingGet(long timeout, TimeUnit unit)
timeout
- the time to wait for a success valueunit
- the time unit of the timeoutpublic final TestSubscriber<T> test()
public final TestSubscriber<T> test(boolean cancel)
cancel
- if true, the TestSubscriber will be cancelled before
subscribing to this Solopublic final TestSubscriber<T> test(long initialRequest)
initialRequest
- the initial request amount, non-negativepublic final TestSubscriber<T> test(long initialRequest, boolean cancel)
initialRequest
- the initial request amount, non-negativecancel
- if true, the TestSubscriber will be cancelled before
subscribing to this Solo