signature:
public class Flowable { /** * Returns a Flowable that represents all of the emissions < em > and < / em > notifications from the source
 * Publisher into emissions marked with their original types within { @ link Notification } objects .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / materialize . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and expects it from the source { @ code Publisher } .
 * If this expectation is violated , the operator < em > may < / em > throw an { @ code IllegalStateException } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code materialize } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Flowable that emits items that are the result of materializing the items and notifications
 * of the source Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / materialize - dematerialize . html " > ReactiveX operators documentation : Materialize < / a >
 * @ see # dematerialize ( Function ) */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < Notification < T > > materialize ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( new FlowableMaterialize < T > ( this ) ) ;


signature:
public class Flowable { /** * Flattens this and another Publisher into a single Publisher , without any transformation .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / merge . png " alt = " " >
 * You can combine items emitted by multiple Publishers so that they appear as a single Publisher , by
 * using the { @ code mergeWith } method .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . This and the other { @ code Publisher } s are expected to honor
 * backpressure ; if violated , the operator < em > may < / em > signal { @ code MissingBackpressureException } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param other
 * a Publisher to be merged
 * @ return a Flowable that emits all of the items emitted by the source Publishers
 * @ see < a href = " http : / / reactivex . io / documentation / operators / merge . html " > ReactiveX operators documentation : Merge < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > mergeWith ( Publisher < ? extends T > other ) { } }

implementation: ObjectHelper . requireNonNull ( other , "other is null" ) ; return merge ( this , other ) ;


signature:
public class Flowable { /** * Merges the sequence of items of this Flowable with the success value of the other SingleSource .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / merge . png " alt = " " >
 * The success value of the other { @ code SingleSource } can get interleaved at any point of this
 * { @ code Flowable } sequence .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and ensures the success item from the
 * { @ code SingleSource } is emitted only when there is a downstream demand . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * < p > History : 2.1.10 - experimental
 * @ param other the { @ code SingleSource } whose success value to merge with
 * @ return the new Flowable instance
 * @ since 2.2 */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > mergeWith ( @ NonNull SingleSource < ? extends T > other ) { } }

implementation: ObjectHelper . requireNonNull ( other , "other is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableMergeWithSingle < T > ( this , other ) ) ;


signature:
public class Flowable { /** * Merges the sequence of items of this Flowable with the success value of the other MaybeSource
 * or waits for both to complete normally if the MaybeSource is empty .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / merge . png " alt = " " >
 * The success value of the other { @ code MaybeSource } can get interleaved at any point of this
 * { @ code Flowable } sequence .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and ensures the success item from the
 * { @ code MaybeSource } is emitted only when there is a downstream demand . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * < p > History : 2.1.10 - experimental
 * @ param other the { @ code MaybeSource } which provides a success value to merge with or completes
 * @ return the new Flowable instance
 * @ since 2.2 */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > mergeWith ( @ NonNull MaybeSource < ? extends T > other ) { } }

implementation: ObjectHelper . requireNonNull ( other , "other is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableMergeWithMaybe < T > ( this , other ) ) ;


signature:
public class Flowable { /** * Modifies a Publisher to perform its emissions and notifications on a specified { @ link Scheduler } ,
 * asynchronously with a bounded buffer of { @ link # bufferSize ( ) } slots .
 * < p > Note that onError notifications will cut ahead of onNext notifications on the emission thread if Scheduler is truly
 * asynchronous . If strict event ordering is required , consider using the { @ link # observeOn ( Scheduler , boolean ) } overload .
 * < img width = " 640 " height = " 308 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / observeOn . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator honors backpressure from downstream and expects it from the source { @ code Publisher } . Violating this
 * expectation will lead to { @ code MissingBackpressureException } . This is the most common operator where the exception
 * pops up ; look for sources up the chain that don ' t support backpressure ,
 * such as { @ code interval } , { @ code timer } , { code PublishSubject } or { @ code BehaviorSubject } and apply any
 * of the { @ code onBackpressureXXX } operators < strong > before < / strong > applying { @ code observeOn } itself . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param scheduler
 * the { @ link Scheduler } to notify { @ link Subscriber } s on
 * @ return the source Publisher modified so that its { @ link Subscriber } s are notified on the specified
 * { @ link Scheduler }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / observeon . html " > ReactiveX operators documentation : ObserveOn < / a >
 * @ see < a href = " http : / / www . grahamlea . com / 2014/07 / rxjava - threading - examples / " > RxJava Threading Examples < / a >
 * @ see # subscribeOn
 * @ see # observeOn ( Scheduler , boolean )
 * @ see # observeOn ( Scheduler , boolean , int ) */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > observeOn ( Scheduler scheduler ) { } }

implementation: return observeOn ( scheduler , false , bufferSize ( ) ) ;


signature:
public class Flowable { /** * Instructs a Publisher that is emitting items faster than its Subscriber can consume them to buffer these
 * items indefinitely until they can be emitted .
 * < img width = " 640 " height = " 300 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / bp . obp . buffer . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an unbounded
 * manner ( i . e . , not applying backpressure to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code onBackpressureBuffer } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the source Publisher modified to buffer items to the extent system resources allow
 * @ see < a href = " http : / / reactivex . io / documentation / operators / backpressure . html " > ReactiveX operators documentation : backpressure operators < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > onBackpressureBuffer ( ) { } }

implementation: return onBackpressureBuffer ( bufferSize ( ) , false , true ) ;


signature:
public class Flowable { /** * Instructs a Publisher that is emitting items faster than its Subscriber can consume them to buffer up to
 * a given amount of items until they can be emitted . The resulting Publisher will signal
 * a { @ code BufferOverflowException } via { @ code onError } as soon as the buffer ' s capacity is exceeded , dropping all undelivered
 * items , and canceling the source .
 * < img width = " 640 " height = " 300 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / bp . obp . buffer . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an unbounded
 * manner ( i . e . , not applying backpressure to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code onBackpressureBuffer } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param capacity number of slots available in the buffer .
 * @ return the source { @ code Publisher } modified to buffer items up to the given capacity .
 * @ see < a href = " http : / / reactivex . io / documentation / operators / backpressure . html " > ReactiveX operators documentation : backpressure operators < / a >
 * @ since 1.1.0 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > onBackpressureBuffer ( int capacity ) { } }

implementation: return onBackpressureBuffer ( capacity , false , false ) ;


signature:
public class Flowable { /** * Instructs a Publisher that is emitting items faster than its Subscriber can consume them to discard ,
 * rather than emit , those items that its Subscriber is not prepared to observe .
 * < img width = " 640 " height = " 245 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / bp . obp . drop . png " alt = " " >
 * If the downstream request count hits 0 then the Publisher will refrain from calling { @ code onNext } until
 * the Subscriber invokes { @ code request ( n ) } again to increase the request count .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an unbounded
 * manner ( i . e . , not applying backpressure to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code onBackpressureDrop } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the source Publisher modified to drop { @ code onNext } notifications on overflow
 * @ see < a href = " http : / / reactivex . io / documentation / operators / backpressure . html " > ReactiveX operators documentation : backpressure operators < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > onBackpressureDrop ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( new FlowableOnBackpressureDrop < T > ( this ) ) ;


signature:
public class Flowable { /** * Instructs a Publisher that is emitting items faster than its Subscriber can consume them to discard ,
 * rather than emit , those items that its Subscriber is not prepared to observe .
 * < img width = " 640 " height = " 245 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / bp . obp . drop . png " alt = " " >
 * If the downstream request count hits 0 then the Publisher will refrain from calling { @ code onNext } until
 * the Subscriber invokes { @ code request ( n ) } again to increase the request count .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an unbounded
 * manner ( i . e . , not applying backpressure to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code onBackpressureDrop } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onDrop the action to invoke for each item dropped . onDrop action should be fast and should never block .
 * @ return the source Publisher modified to drop { @ code onNext } notifications on overflow
 * @ see < a href = " http : / / reactivex . io / documentation / operators / backpressure . html " > ReactiveX operators documentation : backpressure operators < / a >
 * @ since 1.1.0 */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > onBackpressureDrop ( Consumer < ? super T > onDrop ) { } }

implementation: ObjectHelper . requireNonNull ( onDrop , "onDrop is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableOnBackpressureDrop < T > ( this , onDrop ) ) ;


signature:
public class Flowable { /** * Instructs a Publisher to pass control to another Publisher rather than invoking
 * { @ link Subscriber # onError onError } if it encounters an error .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / onErrorResumeNext . png " alt = " " >
 * By default , when a Publisher encounters an error that prevents it from emitting the expected item to
 * its { @ link Subscriber } , the Publisher invokes its Subscriber ' s { @ code onError } method , and then quits
 * without invoking any more of its Subscriber ' s methods . The { @ code onErrorResumeNext } method changes this
 * behavior . If you pass a function that returns a Publisher ( { @ code resumeFunction } ) to
 * { @ code onErrorResumeNext } , if the original Publisher encounters an error , instead of invoking its
 * Subscriber ' s { @ code onError } method , it will instead relinquish control to the Publisher returned from
 * { @ code resumeFunction } , which will invoke the Subscriber ' s { @ link Subscriber # onNext onNext } method if it is
 * able to do so . In such a case , because no Publisher necessarily invokes { @ code onError } , the Subscriber
 * may never know that an error happened .
 * You can use this to prevent errors from propagating or to supply fallback data should errors be
 * encountered .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . This and the resuming { @ code Publisher } s
 * are expected to honor backpressure as well .
 * If any of them violate this expectation , the operator < em > may < / em > throw an
 * { @ code IllegalStateException } when the source { @ code Publisher } completes or
 * a { @ code MissingBackpressureException } is signaled somewhere downstream . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code onErrorResumeNext } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param resumeFunction
 * a function that returns a Publisher that will take over if the source Publisher encounters
 * an error
 * @ return the original Publisher , with appropriately modified behavior
 * @ see < a href = " http : / / reactivex . io / documentation / operators / catch . html " > ReactiveX operators documentation : Catch < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > onErrorResumeNext ( Function < ? super Throwable , ? extends Publisher < ? extends T > > resumeFunction ) { } }

implementation: ObjectHelper . requireNonNull ( resumeFunction , "resumeFunction is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableOnErrorNext < T > ( this , resumeFunction , false ) ) ;


signature:
public class Flowable { /** * Nulls out references to the upstream producer and downstream Subscriber if
 * the sequence is terminated or downstream cancels .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s backpressure
 * behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code onTerminateDetach } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Flowable which nulls out references to the upstream producer and downstream Subscriber if
 * the sequence is terminated or downstream cancels
 * @ since 2.0 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > onTerminateDetach ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( new FlowableDetach < T > ( this ) ) ;


signature:
public class Flowable { /** * Parallelizes the flow by creating multiple ' rails ' ( equal to the number of CPUs )
 * and dispatches the upstream items to them in a round - robin fashion .
 * Note that the rails don ' t execute in parallel on their own and one needs to
 * apply { @ link ParallelFlowable # runOn ( Scheduler ) } to specify the Scheduler where
 * each rail will execute .
 * To merge the parallel ' rails ' back into a single sequence , use { @ link ParallelFlowable # sequential ( ) } .
 * < img width = " 640 " height = " 547 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / flowable . parallel . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator requires the upstream to honor backpressure and each ' rail ' honors backpressure
 * as well . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code parallel } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * < p > History : 2.0.5 - experimental ; 2.1 - beta
 * @ return the new ParallelFlowable instance
 * @ since 2.2 */
@ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) @ CheckReturnValue public final ParallelFlowable < T > parallel ( ) { } }

implementation: return ParallelFlowable . from ( this ) ;


signature:
public class Flowable { /** * Parallelizes the flow by creating the specified number of ' rails '
 * and dispatches the upstream items to them in a round - robin fashion .
 * Note that the rails don ' t execute in parallel on their own and one needs to
 * apply { @ link ParallelFlowable # runOn ( Scheduler ) } to specify the Scheduler where
 * each rail will execute .
 * To merge the parallel ' rails ' back into a single sequence , use { @ link ParallelFlowable # sequential ( ) } .
 * < img width = " 640 " height = " 547 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / flowable . parallel . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator requires the upstream to honor backpressure and each ' rail ' honors backpressure
 * as well . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code parallel } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * < p > History : 2.0.5 - experimental ; 2.1 - beta
 * @ param parallelism the number of ' rails ' to use
 * @ return the new ParallelFlowable instance
 * @ since 2.2 */
@ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) @ CheckReturnValue public final ParallelFlowable < T > parallel ( int parallelism ) { } }

implementation: ObjectHelper . verifyPositive ( parallelism , "parallelism" ) ; return ParallelFlowable . from ( this , parallelism ) ;


signature:
public class Flowable { /** * Returns a { @ link ConnectableFlowable } , which is a variety of Publisher that waits until its
 * { @ link ConnectableFlowable # connect connect } method is called before it begins emitting items to those
 * { @ link Subscriber } s that have subscribed to it .
 * < img width = " 640 " height = " 510 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / publishConnect . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The returned { @ code ConnectableFlowable } honors backpressure for each of its { @ code Subscriber } s
 * and expects the source { @ code Publisher } to honor backpressure as well . If this expectation is violated ,
 * the operator will signal a { @ code MissingBackpressureException } to its { @ code Subscriber } s and disconnect . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code publish } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a { @ link ConnectableFlowable } that upon connection causes the source Publisher to emit items
 * to its { @ link Subscriber } s
 * @ see < a href = " http : / / reactivex . io / documentation / operators / publish . html " > ReactiveX operators documentation : Publish < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final ConnectableFlowable < T > publish ( ) { } }

implementation: return publish ( bufferSize ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits the results of invoking a specified selector on items emitted by a
 * { @ link ConnectableFlowable } that shares a single subscription to the underlying sequence .
 * < img width = " 640 " height = " 510 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / publishConnect . f . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator expects the source { @ code Publisher } to honor backpressure and if this expectation is
 * violated , the operator will signal a { @ code MissingBackpressureException } through the { @ code Publisher }
 * provided to the function . Since the { @ code Publisher } returned by the { @ code selector } may be
 * independent of the provided { @ code Publisher } to the function , the output ' s backpressure behavior
 * is determined by this returned { @ code Publisher } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code publish } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R >
 * the type of items emitted by the resulting Publisher
 * @ param selector
 * a function that can use the multicasted source sequence as many times as needed , without
 * causing multiple subscriptions to the source sequence . Subscribers to the given source will
 * receive all notifications of the source from the time of the subscription forward .
 * @ return a Flowable that emits the results of invoking the selector on the items emitted by a { @ link ConnectableFlowable } that shares a single subscription to the underlying sequence
 * @ see < a href = " http : / / reactivex . io / documentation / operators / publish . html " > ReactiveX operators documentation : Publish < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Flowable < R > publish ( Function < ? super Flowable < T > , ? extends Publisher < R > > selector ) { } }

implementation: return publish ( selector , bufferSize ( ) ) ;


signature:
public class Flowable { /** * Returns a { @ link ConnectableFlowable } , which is a variety of Publisher that waits until its
 * { @ link ConnectableFlowable # connect connect } method is called before it begins emitting items to those
 * { @ link Subscriber } s that have subscribed to it .
 * < img width = " 640 " height = " 510 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / publishConnect . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The returned { @ code ConnectableFlowable } honors backpressure for each of its { @ code Subscriber } s
 * and expects the source { @ code Publisher } to honor backpressure as well . If this expectation is violated ,
 * the operator will signal a { @ code MissingBackpressureException } to its { @ code Subscriber } s and disconnect . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code publish } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param bufferSize
 * the number of elements to prefetch from the current Flowable
 * @ return a { @ link ConnectableFlowable } that upon connection causes the source Publisher to emit items
 * to its { @ link Subscriber } s
 * @ see < a href = " http : / / reactivex . io / documentation / operators / publish . html " > ReactiveX operators documentation : Publish < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final ConnectableFlowable < T > publish ( int bufferSize ) { } }

implementation: ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return FlowablePublish . create ( this , bufferSize ) ;


signature:
public class Flowable { /** * Requests { @ code n } initially from the upstream and then 75 % of { @ code n } subsequently
 * after 75 % of { @ code n } values have been emitted to the downstream .
 * < p > This operator allows preventing the downstream to trigger unbounded mode via { @ code request ( Long . MAX _ VALUE ) }
 * or compensate for the per - item overhead of small and frequent requests .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator expects backpressure from upstream and honors backpressure from downstream . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code rebatchRequests } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param n the initial request amount , further request will happen after 75 % of this value
 * @ return the Publisher that rebatches request amounts from downstream
 * @ since 2.0 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > rebatchRequests ( int n ) { } }

implementation: return observeOn ( ImmediateThinScheduler . INSTANCE , true , n ) ;


signature:
public class Flowable { /** * Returns a Maybe that applies a specified accumulator function to the first item emitted by a source
 * Publisher , then feeds the result of that function along with the second item emitted by the source
 * Publisher into the same function , and so on until all items have been emitted by the finite source Publisher ,
 * and emits the final result from the final call to your function as its sole item .
 * < img width = " 640 " height = " 320 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / reduce . png " alt = " " >
 * This technique , which is called " reduce " here , is sometimes called " aggregate , " " fold , " " accumulate , "
 * " compress , " or " inject " in other programming contexts . Groovy , for instance , has an { @ code inject } method
 * that does a similar operation on lists .
 * Note that this operator requires the upstream to signal { @ code onComplete } for the accumulator object to
 * be emitted . Sources that are infinite and never complete will never emit anything through this
 * operator and an infinite source may lead to a fatal { @ code OutOfMemoryError } .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure of its downstream consumer and consumes the
 * upstream source in unbounded mode . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code reduce } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param reducer
 * an accumulator function to be invoked on each item emitted by the source Publisher , whose
 * result will be used in the next accumulator call
 * @ return a Maybe that emits a single item that is the result of accumulating the items emitted by
 * the source Flowable
 * @ see < a href = " http : / / reactivex . io / documentation / operators / reduce . html " > ReactiveX operators documentation : Reduce < / a >
 * @ see < a href = " http : / / en . wikipedia . org / wiki / Fold _ ( higher - order _ function ) " > Wikipedia : Fold ( higher - order function ) < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Maybe < T > reduce ( BiFunction < T , T , T > reducer ) { } }

implementation: ObjectHelper . requireNonNull ( reducer , "reducer is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableReduceMaybe < T > ( this , reducer ) ) ;


signature:
public class Flowable { /** * Returns a Single that applies a specified accumulator function to the first item emitted by a source
 * Publisher and a specified seed value , then feeds the result of that function along with the second item
 * emitted by a Publisher into the same function , and so on until all items have been emitted by the
 * finite source Publisher , emitting the final result from the final call to your function as its sole item .
 * < img width = " 640 " height = " 325 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / reduceSeed . png " alt = " " >
 * This technique , which is called " reduce " here , is sometimes called " aggregate , " " fold , " " accumulate , "
 * " compress , " or " inject " in other programming contexts . Groovy , for instance , has an { @ code inject } method
 * that does a similar operation on lists .
 * Note that the { @ code seed } is shared among all subscribers to the resulting Publisher
 * and may cause problems if it is mutable . To make sure each subscriber gets its own value , defer
 * the application of this operator via { @ link # defer ( Callable ) } :
 * < pre > < code >
 * Publisher & lt ; T & gt ; source = . . .
 * Single . defer ( ( ) - & gt ; source . reduce ( new ArrayList & lt ; & gt ; ( ) , ( list , item ) - & gt ; list . add ( item ) ) ) ;
 * / / alternatively , by using compose to stay fluent
 * source . compose ( o - & gt ;
 * Flowable . defer ( ( ) - & gt ; o . reduce ( new ArrayList & lt ; & gt ; ( ) , ( list , item ) - & gt ; list . add ( item ) ) . toFlowable ( ) )
 * ) . firstOrError ( ) ;
 * / / or , by using reduceWith instead of reduce
 * source . reduceWith ( ( ) - & gt ; new ArrayList & lt ; & gt ; ( ) , ( list , item ) - & gt ; list . add ( item ) ) ) ;
 * < / code > < / pre >
 * Note that this operator requires the upstream to signal { @ code onComplete } for the accumulator object to
 * be emitted . Sources that are infinite and never complete will never emit anything through this
 * operator and an infinite source may lead to a fatal { @ code OutOfMemoryError } .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure of its downstream consumer and consumes the
 * upstream source in unbounded mode . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code reduce } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R > the accumulator and output value type
 * @ param seed
 * the initial ( seed ) accumulator value
 * @ param reducer
 * an accumulator function to be invoked on each item emitted by the source Publisher , the
 * result of which will be used in the next accumulator call
 * @ return a Single that emits a single item that is the result of accumulating the output from the
 * items emitted by the source Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / reduce . html " > ReactiveX operators documentation : Reduce < / a >
 * @ see < a href = " http : / / en . wikipedia . org / wiki / Fold _ ( higher - order _ function ) " > Wikipedia : Fold ( higher - order function ) < / a >
 * @ see # reduceWith ( Callable , BiFunction ) */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Single < R > reduce ( R seed , BiFunction < R , ? super T , R > reducer ) { } }

implementation: ObjectHelper . requireNonNull ( seed , "seed is null" ) ; ObjectHelper . requireNonNull ( reducer , "reducer is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableReduceSeedSingle < T , R > ( this , seed , reducer ) ) ;


signature:
public class Flowable { /** * Returns a Single that applies a specified accumulator function to the first item emitted by a source
 * Publisher and a seed value derived from calling a specified seedSupplier , then feeds the result
 * of that function along with the second item emitted by a Publisher into the same function , and so on until
 * all items have been emitted by the finite source Publisher , emitting the final result from the final call to your
 * function as its sole item .
 * < img width = " 640 " height = " 325 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / reduceSeed . png " alt = " " >
 * This technique , which is called " reduce " here , is sometimes called " aggregate , " " fold , " " accumulate , "
 * " compress , " or " inject " in other programming contexts . Groovy , for instance , has an { @ code inject } method
 * that does a similar operation on lists .
 * Note that this operator requires the upstream to signal { @ code onComplete } for the accumulator object to
 * be emitted . Sources that are infinite and never complete will never emit anything through this
 * operator and an infinite source may lead to a fatal { @ code OutOfMemoryError } .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure of its downstream consumer and consumes the
 * upstream source in unbounded mode . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code reduceWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R > the accumulator and output value type
 * @ param seedSupplier
 * the Callable that provides the initial ( seed ) accumulator value for each individual Subscriber
 * @ param reducer
 * an accumulator function to be invoked on each item emitted by the source Publisher , the
 * result of which will be used in the next accumulator call
 * @ return a Single that emits a single item that is the result of accumulating the output from the
 * items emitted by the source Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / reduce . html " > ReactiveX operators documentation : Reduce < / a >
 * @ see < a href = " http : / / en . wikipedia . org / wiki / Fold _ ( higher - order _ function ) " > Wikipedia : Fold ( higher - order function ) < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Single < R > reduceWith ( Callable < R > seedSupplier , BiFunction < R , ? super T , R > reducer ) { } }

implementation: ObjectHelper . requireNonNull ( seedSupplier , "seedSupplier is null" ) ; ObjectHelper . requireNonNull ( reducer , "reducer is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableReduceWithSingle < T , R > ( this , seedSupplier , reducer ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that repeats the sequence of items emitted by the source Publisher indefinitely .
 * < img width = " 640 " height = " 309 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / repeat . o . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors downstream backpressure and expects the source { @ code Publisher } to honor backpressure as well .
 * If this expectation is violated , the operator < em > may < / em > throw an { @ code IllegalStateException } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code repeat } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Flowable that emits the items emitted by the source Publisher repeatedly and in sequence
 * @ see < a href = " http : / / reactivex . io / documentation / operators / repeat . html " > ReactiveX operators documentation : Repeat < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > repeat ( ) { } }

implementation: return repeat ( Long . MAX_VALUE ) ;


signature:
public class Flowable { /** * Returns a Flowable that repeats the sequence of items emitted by the source Publisher at most
 * { @ code count } times .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / repeat . on . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors downstream backpressure and expects the source { @ code Publisher } to honor backpressure as well .
 * If this expectation is violated , the operator < em > may < / em > throw an { @ code IllegalStateException } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code repeat } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param times
 * the number of times the source Publisher items are repeated , a count of 0 will yield an empty
 * sequence
 * @ return a Flowable that repeats the sequence of items emitted by the source Publisher at most
 * { @ code count } times
 * @ throws IllegalArgumentException
 * if { @ code count } is less than zero
 * @ see < a href = " http : / / reactivex . io / documentation / operators / repeat . html " > ReactiveX operators documentation : Repeat < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > repeat ( long times ) { } }

implementation: if ( times < 0 ) { throw new IllegalArgumentException ( "times >= 0 required but it was " + times ) ; } if ( times == 0 ) { return empty ( ) ; } return RxJavaPlugins . onAssembly ( new FlowableRepeat < T > ( this , times ) ) ;


signature:
public class Flowable { /** * Returns a { @ link ConnectableFlowable } that shares a single subscription to the underlying Publisher
 * that will replay all of its items and notifications to any future { @ link Subscriber } . A Connectable
 * Publisher resembles an ordinary Publisher , except that it does not begin emitting items when it is
 * subscribed to , but only when its { @ code connect } method is called .
 * < img width = " 640 " height = " 515 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / replay . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator supports backpressure . Note that the upstream requests are determined by the child
 * Subscriber which requests the largest amount : i . e . , two child Subscribers with requests of 10 and 100 will
 * request 100 elements from the underlying Publisher sequence . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code replay } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a { @ link ConnectableFlowable } that upon connection causes the source Publisher to emit its
 * items to its { @ link Subscriber } s
 * @ see < a href = " http : / / reactivex . io / documentation / operators / replay . html " > ReactiveX operators documentation : Replay < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final ConnectableFlowable < T > replay ( ) { } }

implementation: return FlowableReplay . createFrom ( this ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits items that are the results of invoking a specified selector on items
 * emitted by a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher ,
 * replaying no more than { @ code bufferSize } items that were emitted within a specified time window .
 * Note that due to concurrency requirements , { @ code replay ( bufferSize ) } may hold strong references to more than
 * { @ code bufferSize } source emissions .
 * < img width = " 640 " height = " 445 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / replay . fnt . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator supports backpressure . Note that the upstream requests are determined by the child
 * Subscriber which requests the largest amount : i . e . , two child Subscribers with requests of 10 and 100 will
 * request 100 elements from the underlying Publisher sequence . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code replay } operates by default on the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R >
 * the type of items emitted by the resulting Publisher
 * @ param selector
 * a selector function , which can use the multicasted sequence as many times as needed , without
 * causing multiple subscriptions to the Publisher
 * @ param bufferSize
 * the buffer size that limits the number of items the connectable Publisher can replay
 * @ param time
 * the duration of the window in which the replayed items must have been emitted
 * @ param unit
 * the time unit of { @ code time }
 * @ return a Flowable that emits items that are the results of invoking the selector on items emitted by
 * a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher , and
 * replays no more than { @ code bufferSize } items that were emitted within the window defined by
 * { @ code time }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / replay . html " > ReactiveX operators documentation : Replay < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public final < R > Flowable < R > replay ( Function < ? super Flowable < T > , ? extends Publisher < R > > selector , int bufferSize , long time , TimeUnit unit ) { } }

implementation: return replay ( selector , bufferSize , time , unit , Schedulers . computation ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits items that are the results of invoking a specified selector on items
 * emitted by a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher .
 * < img width = " 640 " height = " 445 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / replay . fs . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator supports backpressure . Note that the upstream requests are determined by the child
 * Subscriber which requests the largest amount : i . e . , two child Subscribers with requests of 10 and 100 will
 * request 100 elements from the underlying Publisher sequence . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param < R >
 * the type of items emitted by the resulting Publisher
 * @ param selector
 * a selector function , which can use the multicasted sequence as many times as needed , without
 * causing multiple subscriptions to the Publisher
 * @ param scheduler
 * the Scheduler where the replay is observed
 * @ return a Flowable that emits items that are the results of invoking the selector on items emitted by
 * a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher ,
 * replaying all items
 * @ see < a href = " http : / / reactivex . io / documentation / operators / replay . html " > ReactiveX operators documentation : Replay < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final < R > Flowable < R > replay ( final Function < ? super Flowable < T > , ? extends Publisher < R > > selector , final Scheduler scheduler ) { } }

implementation: ObjectHelper . requireNonNull ( selector , "selector is null" ) ; ObjectHelper . requireNonNull ( scheduler , "scheduler is null" ) ; return FlowableReplay . multicastSelector ( FlowableInternalHelper . replayCallable ( this ) , FlowableInternalHelper . replayFunction ( selector , scheduler ) ) ;


signature:
public class Flowable { /** * Returns a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher that
 * replays at most { @ code bufferSize } items emitted by that Publisher . A Connectable Publisher resembles
 * an ordinary Publisher , except that it does not begin emitting items when it is subscribed to , but only
 * when its { @ code connect } method is called .
 * Note that due to concurrency requirements , { @ code replay ( bufferSize ) } may hold strong references to more than
 * { @ code bufferSize } source emissions .
 * < img width = " 640 " height = " 515 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / replay . n . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator supports backpressure . Note that the upstream requests are determined by the child
 * Subscriber which requests the largest amount : i . e . , two child Subscribers with requests of 10 and 100 will
 * request 100 elements from the underlying Publisher sequence . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code replay } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param bufferSize
 * the buffer size that limits the number of items that can be replayed
 * @ return a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher and
 * replays at most { @ code bufferSize } items emitted by that Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / replay . html " > ReactiveX operators documentation : Replay < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final ConnectableFlowable < T > replay ( final int bufferSize ) { } }

implementation: ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return FlowableReplay . create ( this , bufferSize ) ;


signature:
public class Flowable { /** * Returns a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher and
 * replays at most { @ code bufferSize } items that were emitted during a specified time window . A Connectable
 * Publisher resembles an ordinary Publisher , except that it does not begin emitting items when it is
 * subscribed to , but only when its { @ code connect } method is called .
 * Note that due to concurrency requirements , { @ code replay ( bufferSize ) } may hold strong references to more than
 * { @ code bufferSize } source emissions .
 * < img width = " 640 " height = " 515 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / replay . nt . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator supports backpressure . Note that the upstream requests are determined by the child
 * Subscriber which requests the largest amount : i . e . , two child Subscribers with requests of 10 and 100 will
 * request 100 elements from the underlying Publisher sequence . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code replay } operates by default on the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param bufferSize
 * the buffer size that limits the number of items that can be replayed
 * @ param time
 * the duration of the window in which the replayed items must have been emitted
 * @ param unit
 * the time unit of { @ code time }
 * @ return a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher and
 * replays at most { @ code bufferSize } items that were emitted during the window defined by
 * { @ code time }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / replay . html " > ReactiveX operators documentation : Replay < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public final ConnectableFlowable < T > replay ( int bufferSize , long time , TimeUnit unit ) { } }

implementation: return replay ( bufferSize , time , unit , Schedulers . computation ( ) ) ;


signature:
public class Flowable { /** * Returns a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher and
 * that replays a maximum of { @ code bufferSize } items that are emitted within a specified time window . A
 * Connectable Publisher resembles an ordinary Publisher , except that it does not begin emitting items
 * when it is subscribed to , but only when its { @ code connect } method is called .
 * Note that due to concurrency requirements , { @ code replay ( bufferSize ) } may hold strong references to more than
 * { @ code bufferSize } source emissions .
 * < img width = " 640 " height = " 515 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / replay . nts . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator supports backpressure . Note that the upstream requests are determined by the child
 * Subscriber which requests the largest amount : i . e . , two child Subscribers with requests of 10 and 100 will
 * request 100 elements from the underlying Publisher sequence . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param bufferSize
 * the buffer size that limits the number of items that can be replayed
 * @ param time
 * the duration of the window in which the replayed items must have been emitted
 * @ param unit
 * the time unit of { @ code time }
 * @ param scheduler
 * the scheduler that is used as a time source for the window
 * @ return a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher and
 * replays at most { @ code bufferSize } items that were emitted during the window defined by
 * { @ code time }
 * @ throws IllegalArgumentException
 * if { @ code bufferSize } is less than zero
 * @ see < a href = " http : / / reactivex . io / documentation / operators / replay . html " > ReactiveX operators documentation : Replay < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final ConnectableFlowable < T > replay ( final int bufferSize , final long time , final TimeUnit unit , final Scheduler scheduler ) { } }

implementation: ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; ObjectHelper . requireNonNull ( unit , "unit is null" ) ; ObjectHelper . requireNonNull ( scheduler , "scheduler is null" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return FlowableReplay . create ( this , time , unit , scheduler , bufferSize ) ;


signature:
public class Flowable { /** * Returns a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher and
 * replays at most { @ code bufferSize } items emitted by that Publisher . A Connectable Publisher resembles
 * an ordinary Publisher , except that it does not begin emitting items when it is subscribed to , but only
 * when its { @ code connect } method is called .
 * Note that due to concurrency requirements , { @ code replay ( bufferSize ) } may hold strong references to more than
 * { @ code bufferSize } source emissions .
 * < img width = " 640 " height = " 515 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / replay . ns . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator supports backpressure . Note that the upstream requests are determined by the child
 * Subscriber which requests the largest amount : i . e . , two child Subscribers with requests of 10 and 100 will
 * request 100 elements from the underlying Publisher sequence . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param bufferSize
 * the buffer size that limits the number of items that can be replayed
 * @ param scheduler
 * the scheduler on which the Subscribers will observe the emitted items
 * @ return a { @ link ConnectableFlowable } that shares a single subscription to the source Publisher and
 * replays at most { @ code bufferSize } items that were emitted by the Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / replay . html " > ReactiveX operators documentation : Replay < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final ConnectableFlowable < T > replay ( final int bufferSize , final Scheduler scheduler ) { } }

implementation: ObjectHelper . requireNonNull ( scheduler , "scheduler is null" ) ; return FlowableReplay . observeOn ( replay ( bufferSize ) , scheduler ) ;


signature:
public class Flowable { /** * Returns a Flowable that mirrors the source Publisher , resubscribing to it if it calls { @ code onError }
 * ( infinite retry count ) .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / retry . png " alt = " " >
 * If the source Publisher calls { @ link Subscriber # onError } , this method will resubscribe to the source
 * Publisher rather than propagating the { @ code onError } call .
 * Any and all items emitted by the source Publisher will be emitted by the resulting Publisher , even
 * those emitted during failed subscriptions . For example , if a Publisher fails at first but emits
 * { @ code [ 1 , 2 ] } then succeeds the second time and emits { @ code [ 1 , 2 , 3 , 4 , 5 ] } then the complete sequence
 * of emissions and notifications would be { @ code [ 1 , 2 , 1 , 2 , 3 , 4 , 5 , onComplete ] } .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors downstream backpressure and expects the source { @ code Publisher } to honor backpressure as well .
 * If this expectation is violated , the operator < em > may < / em > throw an { @ code IllegalStateException } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code retry } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the source Publisher modified with retry logic
 * @ see < a href = " http : / / reactivex . io / documentation / operators / retry . html " > ReactiveX operators documentation : Retry < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > retry ( ) { } }

implementation: return retry ( Long . MAX_VALUE , Functions . alwaysTrue ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that mirrors the source Publisher , resubscribing to it if it calls { @ code onError }
 * up to a specified number of retries .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / retry . png " alt = " " >
 * If the source Publisher calls { @ link Subscriber # onError } , this method will resubscribe to the source
 * Publisher for a maximum of { @ code count } resubscriptions rather than propagating the
 * { @ code onError } call .
 * Any and all items emitted by the source Publisher will be emitted by the resulting Publisher , even
 * those emitted during failed subscriptions . For example , if a Publisher fails at first but emits
 * { @ code [ 1 , 2 ] } then succeeds the second time and emits { @ code [ 1 , 2 , 3 , 4 , 5 ] } then the complete sequence
 * of emissions and notifications would be { @ code [ 1 , 2 , 1 , 2 , 3 , 4 , 5 , onComplete ] } .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors downstream backpressure and expects the source { @ code Publisher } to honor backpressure as well .
 * If this expectation is violated , the operator < em > may < / em > throw an { @ code IllegalStateException } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code retry } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param count
 * the number of times to resubscribe if the current Flowable fails
 * @ return the source Publisher modified with retry logic
 * @ see < a href = " http : / / reactivex . io / documentation / operators / retry . html " > ReactiveX operators documentation : Retry < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > retry ( long count ) { } }

implementation: return retry ( count , Functions . alwaysTrue ( ) ) ;


signature:
public class Flowable { /** * Retries the current Flowable if the predicate returns true .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors downstream backpressure and expects the source { @ code Publisher } to honor backpressure as well .
 * If this expectation is violated , the operator < em > may < / em > throw an { @ code IllegalStateException } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code retry } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param predicate the predicate that receives the failure Throwable and should return true to trigger a retry .
 * @ return the new Flowable instance */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > retry ( Predicate < ? super Throwable > predicate ) { } }

implementation: return retry ( Long . MAX_VALUE , predicate ) ;


signature:
public class Flowable { /** * Subscribes to the current Flowable and wraps the given Subscriber into a SafeSubscriber
 * ( if not already a SafeSubscriber ) that
 * deals with exceptions thrown by a misbehaving Subscriber ( that doesn ' t follow the
 * Reactive - Streams specification ) .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator leaves the reactive world and the backpressure behavior depends on the Subscriber ' s behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code safeSubscribe } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param s the incoming Subscriber instance
 * @ throws NullPointerException if s is null */
@ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final void safeSubscribe ( Subscriber < ? super T > s ) { } }

implementation: ObjectHelper . requireNonNull ( s , "s is null" ) ; if ( s instanceof SafeSubscriber ) { subscribe ( ( SafeSubscriber < ? super T > ) s ) ; } else { subscribe ( new SafeSubscriber < T > ( s ) ) ; }


signature:
public class Flowable { /** * Returns a Flowable that emits the most recently emitted item ( if any ) emitted by the source Publisher
 * within periodic time intervals .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / sample . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator does not support backpressure as it uses time to control data flow . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code sample } operates by default on the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param period
 * the sampling rate
 * @ param unit
 * the { @ link TimeUnit } in which { @ code period } is defined
 * @ return a Flowable that emits the results of sampling the items emitted by the source Publisher at
 * the specified time interval
 * @ see < a href = " http : / / reactivex . io / documentation / operators / sample . html " > ReactiveX operators documentation : Sample < / a >
 * @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / Backpressure " > RxJava wiki : Backpressure < / a >
 * @ see # throttleLast ( long , TimeUnit ) */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public final Flowable < T > sample ( long period , TimeUnit unit ) { } }

implementation: return sample ( period , unit , Schedulers . computation ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits the most recently emitted item ( if any ) emitted by the source Publisher
 * within periodic time intervals , where the intervals are defined on a particular Scheduler .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / sample . s . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator does not support backpressure as it uses time to control data flow . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param period
 * the sampling rate
 * @ param unit
 * the { @ link TimeUnit } in which { @ code period } is defined
 * @ param scheduler
 * the { @ link Scheduler } to use when sampling
 * @ return a Flowable that emits the results of sampling the items emitted by the source Publisher at
 * the specified time interval
 * @ see < a href = " http : / / reactivex . io / documentation / operators / sample . html " > ReactiveX operators documentation : Sample < / a >
 * @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / Backpressure " > RxJava wiki : Backpressure < / a >
 * @ see # throttleLast ( long , TimeUnit , Scheduler ) */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > sample ( long period , TimeUnit unit , Scheduler scheduler ) { } }

implementation: ObjectHelper . requireNonNull ( unit , "unit is null" ) ; ObjectHelper . requireNonNull ( scheduler , "scheduler is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableSampleTimed < T > ( this , period , unit , scheduler , false ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that , when the specified { @ code sampler } Publisher emits an item or completes ,
 * emits the most recently emitted item ( if any ) emitted by the source Publisher since the previous
 * emission from the { @ code sampler } Publisher .
 * < img width = " 640 " height = " 289 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / sample . o . nolast . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator does not support backpressure as it uses the emissions of the { @ code sampler }
 * Publisher to control data flow . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code sample } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < U > the element type of the sampler Publisher
 * @ param sampler
 * the Publisher to use for sampling the source Publisher
 * @ return a Flowable that emits the results of sampling the items emitted by this Publisher whenever
 * the { @ code sampler } Publisher emits an item or completes
 * @ see < a href = " http : / / reactivex . io / documentation / operators / sample . html " > ReactiveX operators documentation : Sample < / a >
 * @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / Backpressure " > RxJava wiki : Backpressure < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U > Flowable < T > sample ( Publisher < U > sampler ) { } }

implementation: ObjectHelper . requireNonNull ( sampler , "sampler is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableSamplePublisher < T > ( this , sampler , false ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that applies a specified accumulator function to the first item emitted by a source
 * Publisher and a seed value , then feeds the result of that function along with the second item emitted by
 * the source Publisher into the same function , and so on until all items have been emitted by the source
 * Publisher , emitting the result of each of these iterations .
 * < img width = " 640 " height = " 320 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / scanSeed . png " alt = " " >
 * This sort of function is sometimes called an accumulator .
 * Note that the Publisher that results from this method will emit the value returned by
 * the { @ code seedSupplier } as its first item .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors downstream backpressure and expects the source { @ code Publisher } to honor backpressure as well .
 * Violating this expectation , a { @ code MissingBackpressureException } < em > may < / em > get signaled somewhere downstream . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code scanWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R > the initial , accumulator and result type
 * @ param seedSupplier
 * a Callable that returns the initial ( seed ) accumulator item for each individual Subscriber
 * @ param accumulator
 * an accumulator function to be invoked on each item emitted by the source Publisher , whose
 * result will be emitted to { @ link Subscriber } s via { @ link Subscriber # onNext onNext } and used in the
 * next accumulator call
 * @ return a Flowable that emits { @ code initialValue } followed by the results of each call to the
 * accumulator function
 * @ see < a href = " http : / / reactivex . io / documentation / operators / scan . html " > ReactiveX operators documentation : Scan < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Flowable < R > scanWith ( Callable < R > seedSupplier , BiFunction < R , ? super T , R > accumulator ) { } }

implementation: ObjectHelper . requireNonNull ( seedSupplier , "seedSupplier is null" ) ; ObjectHelper . requireNonNull ( accumulator , "accumulator is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableScanSeed < T , R > ( this , seedSupplier , accumulator ) ) ;


signature:
public class Flowable { /** * Forces a Publisher ' s emissions and notifications to be serialized and for it to obey
 * < a href = " http : / / reactivex . io / documentation / contract . html " > the Publisher contract < / a > in other ways .
 * It is possible for a Publisher to invoke its Subscribers ' methods asynchronously , perhaps from
 * different threads . This could make such a Publisher poorly - behaved , in that it might try to invoke
 * { @ code onComplete } or { @ code onError } before one of its { @ code onNext } invocations , or it might call
 * { @ code onNext } from two different threads concurrently . You can force such a Publisher to be
 * well - behaved and sequential by applying the { @ code serialize } method to it .
 * < img width = " 640 " height = " 400 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / synchronize . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s backpressure
 * behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code serialize } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a { @ link Publisher } that is guaranteed to be well - behaved and to make only serialized calls to
 * its Subscribers
 * @ see < a href = " http : / / reactivex . io / documentation / operators / serialize . html " > ReactiveX operators documentation : Serialize < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > serialize ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( new FlowableSerialized < T > ( this ) ) ;


signature:
public class Flowable { /** * Returns a new { @ link Publisher } that multicasts ( and shares a single subscription to ) the original { @ link Publisher } . As long as
 * there is at least one { @ link Subscriber } this { @ link Publisher } will be subscribed and emitting data .
 * When all subscribers have canceled it will cancel the source { @ link Publisher } .
 * This is an alias for { @ link # publish ( ) } . { @ link ConnectableFlowable # refCount ( ) refCount ( ) } .
 * < img width = " 640 " height = " 510 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / publishRefCount . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure and expects the source { @ code Publisher } to honor backpressure as well .
 * If this expectation is violated , the operator will signal a { @ code MissingBackpressureException } to
 * its { @ code Subscriber } s . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code share } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a { @ code Publisher } that upon connection causes the source { @ code Publisher } to emit items
 * to its { @ link Subscriber } s
 * @ see < a href = " http : / / reactivex . io / documentation / operators / refcount . html " > ReactiveX operators documentation : RefCount < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > share ( ) { } }

implementation: return publish ( ) . refCount ( ) ;


signature:
public class Flowable { /** * Returns a Maybe that completes if this Flowable is empty , signals one item if this Flowable
 * signals exactly one item or signals an { @ code IllegalArgumentException } if this Flowable signals
 * more than one item .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / single . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an
 * unbounded manner ( i . e . , without applying backpressure ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code singleElement } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Maybe that emits the single item emitted by the source Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / first . html " > ReactiveX operators documentation : First < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Maybe < T > singleElement ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( new FlowableSingleMaybe < T > ( this ) ) ;


signature:
public class Flowable { /** * Returns a Single that emits the single item emitted by this Flowable , if this Flowable
 * emits only a single item , otherwise
 * if this Flowable completes without emitting any items a { @ link NoSuchElementException } will be signaled and
 * if this Flowable emits more than one item , an { @ code IllegalArgumentException } will be signaled .
 * < img width = " 640 " height = " 205 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / singleOrError . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an
 * unbounded manner ( i . e . , without applying backpressure ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code singleOrError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the new Single instance
 * @ see < a href = " http : / / reactivex . io / documentation / operators / first . html " > ReactiveX operators documentation : First < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < T > singleOrError ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( new FlowableSingleSingle < T > ( this , null ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that skips the first { @ code count } items emitted by the source Publisher and emits
 * the remainder .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / skip . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s backpressure
 * behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code skip } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param count
 * the number of items to skip
 * @ return a Flowable that is identical to the source Publisher except that it does not emit the first
 * { @ code count } items that the source Publisher emits
 * @ see < a href = " http : / / reactivex . io / documentation / operators / skip . html " > ReactiveX operators documentation : Skip < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > skip ( long count ) { } }

implementation: if ( count <= 0L ) { return RxJavaPlugins . onAssembly ( this ) ; } return RxJavaPlugins . onAssembly ( new FlowableSkip < T > ( this , count ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that skips values emitted by the source Publisher before a specified time window
 * elapses .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / skip . t . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t support backpressure as it uses time to skip an arbitrary number of elements and
 * thus has to consume the source { @ code Publisher } in an unbounded manner ( i . e . , no backpressure applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code skip } does not operate on any particular scheduler but uses the current time
 * from the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param time
 * the length of the time window to skip
 * @ param unit
 * the time unit of { @ code time }
 * @ return a Flowable that skips values emitted by the source Publisher before the time window defined
 * by { @ code time } elapses and the emits the remainder
 * @ see < a href = " http : / / reactivex . io / documentation / operators / skip . html " > ReactiveX operators documentation : Skip < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > skip ( long time , TimeUnit unit ) { } }

implementation: return skipUntil ( timer ( time , unit ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that skips values emitted by the source Publisher before a specified time window
 * on a specified { @ link Scheduler } elapses .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / skip . ts . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t support backpressure as it uses time to skip an arbitrary number of elements and
 * thus has to consume the source { @ code Publisher } in an unbounded manner ( i . e . , no backpressure applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use for the timed skipping < / dd >
 * < / dl >
 * @ param time
 * the length of the time window to skip
 * @ param unit
 * the time unit of { @ code time }
 * @ param scheduler
 * the { @ link Scheduler } on which the timed wait happens
 * @ return a Flowable that skips values emitted by the source Publisher before the time window defined
 * by { @ code time } and { @ code scheduler } elapses , and then emits the remainder
 * @ see < a href = " http : / / reactivex . io / documentation / operators / skip . html " > ReactiveX operators documentation : Skip < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > skip ( long time , TimeUnit unit , Scheduler scheduler ) { } }

implementation: return skipUntil ( timer ( time , unit , scheduler ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that drops a specified number of items from the end of the sequence emitted by the
 * source Publisher .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / skipLast . png " alt = " " >
 * This Subscriber accumulates a queue long enough to store the first { @ code count } items . As more items are
 * received , items are taken from the front of the queue and emitted by the returned Publisher . This causes
 * such items to be delayed .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s backpressure
 * behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code skipLast } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param count
 * number of items to drop from the end of the source sequence
 * @ return a Flowable that emits the items emitted by the source Publisher except for the dropped ones
 * at the end
 * @ throws IndexOutOfBoundsException
 * if { @ code count } is less than zero
 * @ see < a href = " http : / / reactivex . io / documentation / operators / skiplast . html " > ReactiveX operators documentation : SkipLast < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > skipLast ( int count ) { } }

implementation: if ( count < 0 ) { throw new IndexOutOfBoundsException ( "count >= 0 required but it was " + count ) ; } if ( count == 0 ) { return RxJavaPlugins . onAssembly ( this ) ; } return RxJavaPlugins . onAssembly ( new FlowableSkipLast < T > ( this , count ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that drops items emitted by the source Publisher during a specified time window
 * before the source completes .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / skipLast . t . png " alt = " " >
 * Note : this action will cache the latest items arriving in the specified time window .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t support backpressure as it uses time to skip an arbitrary number of elements and
 * thus has to consume the source { @ code Publisher } in an unbounded manner ( i . e . , no backpressure applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code skipLast } does not operate on any particular scheduler but uses the current time
 * from the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param time
 * the length of the time window
 * @ param unit
 * the time unit of { @ code time }
 * @ return a Flowable that drops those items emitted by the source Publisher in a time window before the
 * source completes defined by { @ code time }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / skiplast . html " > ReactiveX operators documentation : SkipLast < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > skipLast ( long time , TimeUnit unit ) { } }

implementation: return skipLast ( time , unit , Schedulers . computation ( ) , false , bufferSize ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that drops items emitted by the source Publisher during a specified time window
 * ( defined on a specified scheduler ) before the source completes .
 * < img width = " 640 " height = " 340 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / skipLast . ts . png " alt = " " >
 * Note : this action will cache the latest items arriving in the specified time window .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t support backpressure as it uses time to skip an arbitrary number of elements and
 * thus has to consume the source { @ code Publisher } in an unbounded manner ( i . e . , no backpressure applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use for tracking the current time < / dd >
 * < / dl >
 * @ param time
 * the length of the time window
 * @ param unit
 * the time unit of { @ code time }
 * @ param scheduler
 * the scheduler used as the time source
 * @ return a Flowable that drops those items emitted by the source Publisher in a time window before the
 * source completes defined by { @ code time } and { @ code scheduler }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / skiplast . html " > ReactiveX operators documentation : SkipLast < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > skipLast ( long time , TimeUnit unit , Scheduler scheduler ) { } }

implementation: return skipLast ( time , unit , scheduler , false , bufferSize ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that skips all items emitted by the source Publisher as long as a specified
 * condition holds true , but emits all further source items as soon as the condition becomes false .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / skipWhile . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s backpressure
 * behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code skipWhile } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param predicate
 * a function to test each item emitted from the source Publisher
 * @ return a Flowable that begins emitting items emitted by the source Publisher when the specified
 * predicate becomes false
 * @ see < a href = " http : / / reactivex . io / documentation / operators / skipwhile . html " > ReactiveX operators documentation : SkipWhile < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > skipWhile ( Predicate < ? super T > predicate ) { } }

implementation: ObjectHelper . requireNonNull ( predicate , "predicate is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableSkipWhile < T > ( this , predicate ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits the events emitted by source Publisher , in a
 * sorted order . Each item emitted by the Publisher must implement { @ link Comparable } with respect to all
 * other items in the sequence .
 * < p > If any item emitted by this Flowable does not implement { @ link Comparable } with respect to
 * all other items emitted by this Flowable , no items will be emitted and the
 * sequence is terminated with a { @ link ClassCastException } .
 * < p > Note that calling { @ code sorted } with long , non - terminating or infinite sources
 * might cause { @ link OutOfMemoryError }
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an
 * unbounded manner ( i . e . , without applying backpressure to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code sorted } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Flowable that emits the items emitted by the source Publisher in sorted order */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > sorted ( ) { } }

implementation: return toList ( ) . toFlowable ( ) . map ( Functions . listSorter ( Functions . < T > naturalComparator ( ) ) ) . flatMapIterable ( Functions . < List < T > > identity ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits the events emitted by source Publisher , in a
 * sorted order based on a specified comparison function .
 * < p > Note that calling { @ code sorted } with long , non - terminating or infinite sources
 * might cause { @ link OutOfMemoryError }
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an
 * unbounded manner ( i . e . , without applying backpressure to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code sorted } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param sortFunction
 * a function that compares two items emitted by the source Publisher and returns an Integer
 * that indicates their sort order
 * @ return a Flowable that emits the items emitted by the source Publisher in sorted order */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > sorted ( Comparator < ? super T > sortFunction ) { } }

implementation: ObjectHelper . requireNonNull ( sortFunction , "sortFunction" ) ; return toList ( ) . toFlowable ( ) . map ( Functions . listSorter ( sortFunction ) ) . flatMapIterable ( Functions . < List < T > > identity ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits the items in a specified { @ link Iterable } before it begins to emit items
 * emitted by the source Publisher .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / startWith . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . The source { @ code Publisher }
 * is expected to honor backpressure as well . If it violates this rule , it < em > may < / em > throw an
 * { @ code IllegalStateException } when the source { @ code Publisher } completes . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code startWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param items
 * an Iterable that contains the items you want the modified Publisher to emit first
 * @ return a Flowable that emits the items in the specified { @ link Iterable } and then emits the items
 * emitted by the source Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / startwith . html " > ReactiveX operators documentation : StartWith < / a > */
@ SuppressWarnings ( "unchecked" ) @ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > startWith ( Iterable < ? extends T > items ) { } }

implementation: return concatArray ( fromIterable ( items ) , this ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits the specified items before it begins to emit items emitted by the source
 * Publisher .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / startWith . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . The source { @ code Publisher }
 * is expected to honor backpressure as well . If it violates this rule , it < em > may < / em > throw an
 * { @ code IllegalStateException } when the source { @ code Publisher } completes . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code startWithArray } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param items
 * the array of values to emit first
 * @ return a Flowable that emits the specified items before it begins to emit items emitted by the source
 * Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / startwith . html " > ReactiveX operators documentation : StartWith < / a > */
@ SuppressWarnings ( "unchecked" ) @ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > startWithArray ( T ... items ) { } }

implementation: Flowable < T > fromArray = fromArray ( items ) ; if ( fromArray == empty ( ) ) { return RxJavaPlugins . onAssembly ( this ) ; } return concatArray ( fromArray , this ) ;


signature:
public class Flowable { /** * Subscribes to a Publisher and ignores { @ code onNext } and { @ code onComplete } emissions .
 * If the Flowable emits an error , it is wrapped into an
 * { @ link io . reactivex . exceptions . OnErrorNotImplementedException OnErrorNotImplementedException }
 * and routed to the RxJavaPlugins . onError handler .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the source { @ code Publisher } in an unbounded manner ( i . e . , no
 * backpressure is applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code subscribe } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a { @ link Disposable } reference with which the caller can stop receiving items before
 * the Publisher has finished sending them
 * @ see < a href = " http : / / reactivex . io / documentation / operators / subscribe . html " > ReactiveX operators documentation : Subscribe < / a > */
@ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Disposable subscribe ( ) { } }

implementation: return subscribe ( Functions . emptyConsumer ( ) , Functions . ON_ERROR_MISSING , Functions . EMPTY_ACTION , FlowableInternalHelper . RequestMax . INSTANCE ) ;


signature:
public class Flowable { /** * Subscribes to a Publisher and provides a callback to handle the items it emits .
 * If the Flowable emits an error , it is wrapped into an
 * { @ link io . reactivex . exceptions . OnErrorNotImplementedException OnErrorNotImplementedException }
 * and routed to the RxJavaPlugins . onError handler .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the source { @ code Publisher } in an unbounded manner ( i . e . , no
 * backpressure is applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code subscribe } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onNext
 * the { @ code Consumer < T > } you have designed to accept emissions from the Publisher
 * @ return a { @ link Disposable } reference with which the caller can stop receiving items before
 * the Publisher has finished sending them
 * @ throws NullPointerException
 * if { @ code onNext } is null
 * @ see < a href = " http : / / reactivex . io / documentation / operators / subscribe . html " > ReactiveX operators documentation : Subscribe < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Disposable subscribe ( Consumer < ? super T > onNext ) { } }

implementation: return subscribe ( onNext , Functions . ON_ERROR_MISSING , Functions . EMPTY_ACTION , FlowableInternalHelper . RequestMax . INSTANCE ) ;


signature:
public class Flowable { /** * Establish a connection between this Flowable and the given FlowableSubscriber and
 * start streaming events based on the demand of the FlowableSubscriber .
 * This is a " factory method " and can be called multiple times , each time starting a new { @ link Subscription } .
 * Each { @ link Subscription } will work for only a single { @ link FlowableSubscriber } .
 * If the same { @ link FlowableSubscriber } instance is subscribed to multiple { @ link Flowable } s and / or the
 * same { @ link Flowable } multiple times , it must ensure the serialization over its { @ code onXXX }
 * methods manually .
 * If the { @ link Flowable } rejects the subscription attempt or otherwise fails it will signal
 * the error via { @ link FlowableSubscriber # onError ( Throwable ) } .
 * This subscribe method relaxes the following Reactive - Streams rules :
 * < ul >
 * < li > § 1.3 : onNext should not be called concurrently until onSubscribe returns .
 * < b > FlowableSubscriber . onSubscribe should make sure a sync or async call triggered by request ( ) is safe . < / b > < / li >
 * < li > § 2.3 : onError or onComplete must not call cancel .
 * < b > Calling request ( ) or cancel ( ) is NOP at this point . < / b > < / li >
 * < li > § 2.12 : onSubscribe must be called at most once on the same instance .
 * < b > FlowableSubscriber reuse is not checked and if happens , it is the responsibility of
 * the FlowableSubscriber to ensure proper serialization of its onXXX methods . < / b > < / li >
 * < li > § 3.9 : negative requests should emit an onError ( IllegalArgumentException ) .
 * < b > Non - positive requests signal via RxJavaPlugins . onError and the stream is not affected . < / b > < / li >
 * < / ul >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The backpressure behavior / expectation is determined by the supplied { @ code FlowableSubscriber } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code subscribe } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * < p > History : 2.0.7 - experimental ; 2.1 - beta
 * @ param s the FlowableSubscriber that will consume signals from this Flowable
 * @ since 2.2 */
@ BackpressureSupport ( BackpressureKind . SPECIAL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final void subscribe ( FlowableSubscriber < ? super T > s ) { } }

implementation:
ObjectHelper . requireNonNull ( s , "s is null" ) ; try { Subscriber < ? super T > z = RxJavaPlugins . onSubscribe ( this , s ) ; ObjectHelper . requireNonNull ( z , "The RxJavaPlugins.onSubscribe hook returned a null FlowableSubscriber. Please check the handler provided to RxJavaPlugins.setOnFlowableSubscribe for invalid null returns. Further reading: https://github.com/ReactiveX/RxJava/wiki/Plugins" ) ; subscribeActual ( z ) ; } catch ( NullPointerException e ) { // NOPMD
throw e ; } catch ( Throwable e ) { Exceptions . throwIfFatal ( e ) ; // can ' t call onError because no way to know if a Subscription has been set or not
// can ' t call onSubscribe because the call might have set a Subscription already
RxJavaPlugins . onError ( e ) ; NullPointerException npe = new NullPointerException ( "Actually not, but can't throw other exceptions due to RS" ) ; npe . initCause ( e ) ; throw npe ; }