signature:
public class Flowable { /** * Subscribes a given Subscriber ( subclass ) to this Flowable and returns the given
 * Subscriber as is .
 * < p > Usage example :
 * < pre > < code >
 * Flowable & lt ; Integer & gt ; source = Flowable . range ( 1 , 10 ) ;
 * CompositeDisposable composite = new CompositeDisposable ( ) ;
 * ResourceSubscriber & lt ; Integer & gt ; rs = new ResourceSubscriber & lt ; & gt ; ( ) {
 * composite . add ( source . subscribeWith ( rs ) ) ;
 * < / code > < / pre >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The backpressure behavior / expectation is determined by the supplied { @ code Subscriber } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code subscribeWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < E > the type of the Subscriber to use and return
 * @ param subscriber the Subscriber ( subclass ) to use and return , not null
 * @ return the input { @ code subscriber }
 * @ throws NullPointerException if { @ code subscriber } is null
 * @ since 2.0 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . SPECIAL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < E extends Subscriber < ? super T > > E subscribeWith ( E subscriber ) { } }

implementation: subscribe ( subscriber ) ; return subscriber ;


signature:
public class Flowable { /** * Asynchronously subscribes Subscribers to this Publisher on the specified { @ link Scheduler }
 * optionally reroutes requests from other threads to the same { @ link Scheduler } thread .
 * If there is a { @ link # create ( FlowableOnSubscribe , BackpressureStrategy ) } type source up in the
 * chain , it is recommended to have { @ code requestOn } false to avoid same - pool deadlock
 * because requests may pile up behind an eager / blocking emitter .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / subscribeOn . 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 > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * < p > History : 2.1.1 - experimental
 * @ param scheduler
 * the { @ link Scheduler } to perform subscription actions on
 * @ param requestOn if true , requests are rerouted to the given Scheduler as well ( strong pipelining )
 * if false , requests coming from any thread are simply forwarded to
 * the upstream on the same thread ( weak pipelining )
 * @ return the source Publisher modified so that its subscriptions happen on the
 * specified { @ link Scheduler }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / subscribeon . html " > ReactiveX operators documentation : SubscribeOn < / a >
 * @ see < a href = " http : / / www . grahamlea . com / 2014/07 / rxjava - threading - examples / " > RxJava Threading Examples < / a >
 * @ see # observeOn
 * @ since 2.2 */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > subscribeOn ( @ NonNull Scheduler scheduler , boolean requestOn ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that emits the items emitted by the source Publisher or the items of an alternate
 * Publisher if the source Publisher is empty .
 * < img width = " 640 " height = " 255 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / switchifempty . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > If the source { @ code Publisher } is empty , the alternate { @ code Publisher } is expected to honor backpressure .
 * If the source { @ code Publisher } is non - empty , it is expected to honor backpressure as instead .
 * In either case , if violated , a { @ code MissingBackpressureException } < em > may < / em > get
 * signaled somewhere downstream .
 * < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code switchIfEmpty } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param other
 * the alternate Publisher to subscribe to if the source does not emit any items
 * @ return a Publisher that emits the items emitted by the source Publisher or the items of an
 * alternate Publisher if the source Publisher is empty .
 * @ since 1.1.0 */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > switchIfEmpty ( Publisher < ? extends T > other ) { } }

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


signature:
public class Flowable { /** * Maps the upstream values into { @ link CompletableSource } s , subscribes to the newer one while
 * disposing the subscription to the previous { @ code CompletableSource } , thus keeping at most one
 * active { @ code CompletableSource } running .
 * < img width = " 640 " height = " 521 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / switchMapCompletable . f . png " alt = " " >
 * Since a { @ code CompletableSource } doesn ' t produce any items , the resulting reactive type of
 * this operator is a { @ link Completable } that can only indicate successful completion or
 * a failure in any of the inner { @ code CompletableSource } s or the failure of the current
 * { @ link Flowable } .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the current { @ link Flowable } in an unbounded manner and otherwise
 * does not have backpressure in its return type because no items are ever produced . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code switchMapCompletable } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Error handling : < / b > < / dt >
 * < dd > If either this { @ code Flowable } or the active { @ code CompletableSource } signals an { @ code onError } ,
 * the resulting { @ code Completable } is terminated immediately with that { @ code Throwable } .
 * Use the { @ link # switchMapCompletableDelayError ( Function ) } to delay such inner failures until
 * every inner { @ code CompletableSource } s and the main { @ code Flowable } terminates in some fashion .
 * If they fail concurrently , the operator may combine the { @ code Throwable } s into a
 * { @ link io . reactivex . exceptions . CompositeException CompositeException }
 * and signal it to the downstream instead . If any inactivated ( switched out ) { @ code CompletableSource }
 * signals an { @ code onError } late , the { @ code Throwable } s will be signaled to the global error handler via
 * { @ link RxJavaPlugins # onError ( Throwable ) } method as { @ code UndeliverableException } errors .
 * < / dd >
 * < / dl >
 * < p > History : 2.1.11 - experimental
 * @ param mapper the function called with each upstream item and should return a
 * { @ link CompletableSource } to be subscribed to and awaited for
 * ( non blockingly ) for its terminal event
 * @ return the new Completable instance
 * @ see # switchMapCompletableDelayError ( Function )
 * @ since 2.2 */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Completable switchMapCompletable ( @ NonNull Function < ? super T , ? extends CompletableSource > mapper ) { } }

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


signature:
public class Flowable { /** * Returns a new Publisher by applying a function that you supply to each item emitted by the source
 * Publisher that returns a Publisher , and then emitting the items emitted by the most recently emitted
 * of these Publishers and delays any error until all Publishers terminate .
 * The resulting Publisher completes if both the upstream Publisher and the last inner Publisher , if any , complete .
 * If the upstream Publisher signals an onError , the termination of the last inner Publisher will emit that error as is
 * or wrapped into a CompositeException along with the other possible errors the former inner Publishers signaled .
 * < img width = " 640 " height = " 350 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / switchMap . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . The outer { @ code Publisher } is consumed in an
 * unbounded manner ( i . e . , without backpressure ) and the inner { @ code Publisher } s are expected to honor
 * backpressure but it is not enforced ; the operator won ' t signal a { @ code MissingBackpressureException }
 * but the violation < em > may < / em > lead to { @ code OutOfMemoryError } due to internal buffer bloat . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code switchMapDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R > the element type of the inner Publishers and the output
 * @ param mapper
 * a function that , when applied to an item emitted by the source Publisher , returns a
 * Publisher
 * @ return a Flowable that emits the items emitted by the Publisher returned from applying { @ code func } to the most recently emitted item emitted by the source Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / flatmap . html " > ReactiveX operators documentation : FlatMap < / a >
 * @ since 2.0 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . SPECIAL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Flowable < R > switchMapDelayError ( Function < ? super T , ? extends Publisher < ? extends R > > mapper ) { } }

implementation: return switchMapDelayError ( mapper , bufferSize ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits only the first { @ code count } items emitted by the source Publisher . If the source emits fewer than
 * { @ code count } items then all of its items are emitted .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / take . png " alt = " " >
 * This method returns a Publisher that will invoke a subscribing { @ link Subscriber } ' s
 * { @ link Subscriber # onNext onNext } function a maximum of { @ code count } times before invoking
 * { @ link Subscriber # onComplete onComplete } .
 * < 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 in case the first request is smaller than the { @ code count } . Otherwise , the source { @ code Publisher }
 * is consumed in an unbounded manner ( i . e . , without applying backpressure to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code take } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param count
 * the maximum number of items to emit
 * @ return a Flowable that emits only the first { @ code count } items emitted by the source Publisher , or
 * all of the items from the source Publisher if that Publisher emits fewer than { @ code count } items
 * @ see < a href = " http : / / reactivex . io / documentation / operators / take . html " > ReactiveX operators documentation : Take < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . SPECIAL ) // may trigger UNBOUNDED _ IN
@ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > take ( long count ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that emits those items emitted by source Publisher before a specified time runs
 * out .
 * If time runs out before the { @ code Flowable } completes normally , the { @ code onComplete } event will be
 * signaled on the default { @ code computation } { @ link Scheduler } .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / take . t . 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 take } operates by default on 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 emits those items emitted by the source Publisher before the time runs out
 * @ see < a href = " http : / / reactivex . io / documentation / operators / take . html " > ReactiveX operators documentation : Take < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public final Flowable < T > take ( long time , TimeUnit unit ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that emits those items emitted by source Publisher before a specified time ( on a
 * specified Scheduler ) runs out .
 * If time runs out before the { @ code Flowable } completes normally , the { @ code onComplete } event will be
 * signaled on the provided { @ link Scheduler } .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / take . ts . 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 > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param time
 * the length of the time window
 * @ param unit
 * the time unit of { @ code time }
 * @ param scheduler
 * the Scheduler used for time source
 * @ return a Flowable that emits those items emitted by the source Publisher before the time runs out ,
 * according to the specified Scheduler
 * @ see < a href = " http : / / reactivex . io / documentation / operators / take . html " > ReactiveX operators documentation : Take < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > take ( long time , TimeUnit unit , Scheduler scheduler ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that emits at most the last { @ code count } items emitted by the source Publisher . If the source emits fewer than
 * { @ code count } items then all of its items are emitted .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / takeLast . n . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream if the { @ code count } is non - zero ; ignores
 * backpressure if the { @ code count } is zero as it doesn ' t signal any values . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code takeLast } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param count
 * the maximum number of items to emit from the end of the sequence of items emitted by the source
 * Publisher
 * @ return a Flowable that emits at most the last { @ code count } items emitted by the source Publisher
 * @ throws IndexOutOfBoundsException
 * if { @ code count } is less than zero
 * @ see < a href = " http : / / reactivex . io / documentation / operators / takelast . html " > ReactiveX operators documentation : TakeLast < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > takeLast ( int count ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that emits at most a specified number of items from the source Publisher that were
 * emitted in a specified window of time before the Publisher completed .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / takeLast . tn . 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 . , no backpressure is applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code takeLast } does not operate on any particular scheduler but uses the current time
 * from the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param count
 * the maximum number of items to emit
 * @ param time
 * the length of the time window
 * @ param unit
 * the time unit of { @ code time }
 * @ return a Flowable that emits at most { @ code count } items from the source Publisher that were emitted
 * in a specified window of time before the Publisher completed
 * @ see < a href = " http : / / reactivex . io / documentation / operators / takelast . html " > ReactiveX operators documentation : TakeLast < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > takeLast ( long count , long time , TimeUnit unit ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that emits at most a specified number of items from the source Publisher that were
 * emitted in a specified window of time before the Publisher completed , where the timing information is
 * provided by a given Scheduler .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / takeLast . tns . 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 . , no backpressure is 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 count
 * the maximum number of items to emit
 * @ param time
 * the length of the time window
 * @ param unit
 * the time unit of { @ code time }
 * @ param scheduler
 * the { @ link Scheduler } that provides the timestamps for the observed items
 * @ param delayError
 * if true , an exception signaled by the current Flowable is delayed until the regular elements are consumed
 * by the downstream ; if false , an exception is immediately signaled and all regular elements dropped
 * @ param bufferSize
 * the hint about how many elements to expect to be last
 * @ return a Flowable that emits at most { @ code count } items from the source Publisher that were emitted
 * in a specified window of time before the Publisher completed , where the timing information is
 * provided by the given { @ code scheduler }
 * @ throws IndexOutOfBoundsException
 * if { @ code count } is less than zero
 * @ see < a href = " http : / / reactivex . io / documentation / operators / takelast . html " > ReactiveX operators documentation : TakeLast < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > takeLast ( long count , long time , TimeUnit unit , Scheduler scheduler , boolean delayError , int bufferSize ) { } }

implementation: ObjectHelper . requireNonNull ( unit , "unit is null" ) ; ObjectHelper . requireNonNull ( scheduler , "scheduler is null" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; if ( count < 0 ) { throw new IndexOutOfBoundsException ( "count >= 0 required but it was " + count ) ; } return RxJavaPlugins . onAssembly ( new FlowableTakeLastTimed < T > ( this , count , time , unit , scheduler , bufferSize , delayError ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits the items from the source Publisher that were emitted in a specified
 * window of time before the Publisher completed , where the timing information is provided by a specified
 * Scheduler .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / takeLast . ts . 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 . , no backpressure is applied to it ) but note that this < em > may < / em >
 * lead to { @ code OutOfMemoryError } due to internal buffer bloat .
 * Consider using { @ link # takeLast ( long , long , TimeUnit , Scheduler ) } in this case . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param time
 * the length of the time window
 * @ param unit
 * the time unit of { @ code time }
 * @ param scheduler
 * the Scheduler that provides the timestamps for the Observed items
 * @ param delayError
 * if true , an exception signaled by the current Flowable is delayed until the regular elements are consumed
 * by the downstream ; if false , an exception is immediately signaled and all regular elements dropped
 * @ param bufferSize
 * the hint about how many elements to expect to be last
 * @ return a Flowable that emits the items from the source Publisher that were emitted in the window of
 * time before the Publisher completed specified by { @ code time } , where the timing information is
 * provided by { @ code scheduler }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / takelast . html " > ReactiveX operators documentation : TakeLast < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > takeLast ( long time , TimeUnit unit , Scheduler scheduler , boolean delayError , int bufferSize ) { } }

implementation: return takeLast ( Long . MAX_VALUE , time , unit , scheduler , delayError , bufferSize ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits items emitted by the source Publisher , checks the specified predicate
 * for each item , and then completes when the condition is satisfied .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / takeUntil . p . png " alt = " " >
 * The difference between this operator and { @ link # takeWhile ( Predicate ) } is that here , the condition is
 * evaluated < em > after < / em > the item is emitted .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator is a pass - through for backpressure ; the backpressure behavior is determined by the upstream
 * source and the downstream consumer . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code takeUntil } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param stopPredicate
 * a function that evaluates an item emitted by the source Publisher and returns a Boolean
 * @ return a Flowable that first emits items emitted by the source Publisher , checks the specified
 * condition after each item , and then completes when the condition is satisfied .
 * @ see < a href = " http : / / reactivex . io / documentation / operators / takeuntil . html " > ReactiveX operators documentation : TakeUntil < / a >
 * @ see Flowable # takeWhile ( Predicate )
 * @ since 1.1.0 */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > takeUntil ( Predicate < ? super T > stopPredicate ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that emits the items emitted by the source Publisher until a second Publisher
 * emits an item .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / takeUntil . 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 takeUntil } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param other
 * the Publisher whose first emitted item will cause { @ code takeUntil } to stop emitting items
 * from the source Publisher
 * @ param < U >
 * the type of items emitted by { @ code other }
 * @ return a Flowable that emits the items emitted by the source Publisher until such time as { @ code other } emits its first item
 * @ see < a href = " http : / / reactivex . io / documentation / operators / takeuntil . html " > ReactiveX operators documentation : TakeUntil < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U > Flowable < T > takeUntil ( Publisher < U > other ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that emits items emitted by the source Publisher so long as each item satisfied a
 * specified condition , and then completes as soon as this condition is not satisfied .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / takeWhile . 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 takeWhile } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param predicate
 * a function that evaluates an item emitted by the source Publisher and returns a Boolean
 * @ return a Flowable that emits the items from the source Publisher so long as each item satisfies the
 * condition defined by { @ code predicate } , then completes
 * @ see < a href = " http : / / reactivex . io / documentation / operators / takewhile . html " > ReactiveX operators documentation : TakeWhile < / a >
 * @ see Flowable # takeUntil ( Predicate ) */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > takeWhile ( Predicate < ? super T > predicate ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that emits only the first item emitted by the source Publisher during sequential
 * time windows of a specified duration .
 * This differs from { @ link # throttleLast } in that this only tracks the passage of time whereas
 * { @ link # throttleLast } ticks at scheduled intervals .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / throttleFirst . 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 throttleFirst } operates by default on the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param windowDuration
 * time to wait before emitting another item after emitting the last item
 * @ param unit
 * the unit of time of { @ code windowDuration }
 * @ return a Flowable that performs the throttle operation
 * @ 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 @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public final Flowable < T > throttleFirst ( long windowDuration , TimeUnit unit ) { } }

implementation: return throttleFirst ( windowDuration , unit , Schedulers . computation ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits only the last item emitted by the source Publisher during sequential
 * time windows of a specified duration .
 * This differs from { @ link # throttleFirst } in that this ticks along at a scheduled interval whereas
 * { @ link # throttleFirst } does not tick , it just tracks the passage of time .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / throttleLast . 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 throttleLast } operates by default on the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param intervalDuration
 * duration of windows within which the last item emitted by the source Publisher will be
 * emitted
 * @ param unit
 * the unit of time of { @ code intervalDuration }
 * @ return a Flowable that performs the throttle operation
 * @ 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 # sample ( long , TimeUnit ) */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public final Flowable < T > throttleLast ( long intervalDuration , TimeUnit unit ) { } }

implementation: return sample ( intervalDuration , unit ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits only the last item emitted by the source Publisher during sequential
 * time windows of a specified duration , where the duration is governed by a specified Scheduler .
 * This differs from { @ link # throttleFirst } in that this ticks along at a scheduled interval whereas
 * { @ link # throttleFirst } does not tick , it just tracks the passage of time .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / throttleLast . 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 intervalDuration
 * duration of windows within which the last item emitted by the source Publisher will be
 * emitted
 * @ param unit
 * the unit of time of { @ code intervalDuration }
 * @ param scheduler
 * the { @ link Scheduler } to use internally to manage the timers that handle timeout for each
 * event
 * @ return a Flowable that performs the throttle operation
 * @ 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 # sample ( long , TimeUnit , Scheduler ) */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > throttleLast ( long intervalDuration , TimeUnit unit , Scheduler scheduler ) { } }

implementation: return sample ( intervalDuration , unit , scheduler ) ;


signature:
public class Flowable { /** * Returns a Flowable that mirrors the source Publisher , except that it drops items emitted by the
 * source Publisher that are followed by newer items before a timeout value expires on a specified
 * Scheduler . The timer resets on each emission ( alias to { @ link # debounce ( long , TimeUnit , Scheduler ) } ) .
 * < em > Note : < / em > If items keep being emitted by the source Publisher faster than the timeout then no items
 * will be emitted by the resulting Publisher .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / throttleWithTimeout . 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 timeout
 * the length of the window of time that must pass after the emission of an item from the source
 * Publisher in which that Publisher emits no items in order for the item to be emitted by the
 * resulting Publisher
 * @ param unit
 * the unit of time for the specified { @ code timeout }
 * @ param scheduler
 * the { @ link Scheduler } to use internally to manage the timers that handle the timeout for each
 * item
 * @ return a Flowable that filters out items from the source Publisher that are too quickly followed by
 * newer items
 * @ see < a href = " http : / / reactivex . io / documentation / operators / debounce . html " > ReactiveX operators documentation : Debounce < / a >
 * @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / Backpressure " > RxJava wiki : Backpressure < / a >
 * @ see # debounce ( long , TimeUnit , Scheduler ) */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > throttleWithTimeout ( long timeout , TimeUnit unit , Scheduler scheduler ) { } }

implementation: return debounce ( timeout , unit , scheduler ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits records of the time interval between consecutive items emitted by the
 * source Publisher .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / timeInterval . 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 timeInterval } does not operate on any particular scheduler but uses the current time
 * from the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param unit the time unit for the current time
 * @ return a Flowable that emits time interval information items
 * @ see < a href = " http : / / reactivex . io / documentation / operators / timeinterval . html " > ReactiveX operators documentation : TimeInterval < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < Timed < T > > timeInterval ( TimeUnit unit ) { } }

implementation: return timeInterval ( unit , Schedulers . computation ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits records of the time interval between consecutive items emitted by the
 * source Publisher , where this interval is computed on a specified Scheduler .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / timeInterval . s . 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 > The operator does not operate on any particular scheduler but uses the current time
 * from the specified { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param unit the time unit for the current time
 * @ param scheduler
 * the { @ link Scheduler } used to compute time intervals
 * @ return a Flowable that emits time interval information items
 * @ see < a href = " http : / / reactivex . io / documentation / operators / timeinterval . html " > ReactiveX operators documentation : TimeInterval < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) // Supplied scheduler is only used for creating timestamps .
public final Flowable < Timed < T > > timeInterval ( TimeUnit unit , Scheduler scheduler ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that mirrors the source Publisher , but notifies Subscribers of a
 * { @ code TimeoutException } if an item emitted by the source Publisher doesn ' t arrive within a window of
 * time after the emission of the previous item , where that period of time is measured by a Publisher that
 * is a function of the previous item .
 * < img width = " 640 " height = " 400 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / timeout3 . png " alt = " " >
 * Note : The arrival of the first source item is never timed out .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . The { @ code Publisher }
 * sources are expected to honor backpressure as well .
 * If any of the source { @ code Publisher } s violate this , it < em > may < / em > throw an
 * { @ code IllegalStateException } when the source { @ code Publisher } completes . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code timeout } operates by default on the { @ code immediate } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < V >
 * the timeout value type ( ignored )
 * @ param itemTimeoutIndicator
 * a function that returns a Publisher for each item emitted by the source
 * Publisher and that determines the timeout window for the subsequent item
 * @ return a Flowable that mirrors the source Publisher , but notifies Subscribers of a
 * { @ code TimeoutException } if an item emitted by the source Publisher takes longer to arrive than
 * the time window defined by the selector for the previously emitted item
 * @ see < a href = " http : / / reactivex . io / documentation / operators / timeout . html " > ReactiveX operators documentation : Timeout < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < V > Flowable < T > timeout ( Function < ? super T , ? extends Publisher < V > > itemTimeoutIndicator ) { } }

implementation: return timeout0 ( null , itemTimeoutIndicator , null ) ;


signature:
public class Flowable { /** * Returns a Flowable that mirrors the source Publisher but applies a timeout policy for each emitted
 * item . If the next item isn ' t emitted within the specified timeout duration starting from its predecessor ,
 * the resulting Publisher terminates and notifies Subscribers of a { @ code TimeoutException } .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / timeout . 1 . 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 timeout } operates by default on the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param timeout
 * maximum duration between emitted items before a timeout occurs
 * @ param timeUnit
 * the unit of time that applies to the { @ code timeout } argument .
 * @ return the source Publisher modified to notify Subscribers of a { @ code TimeoutException } in case of a
 * timeout
 * @ see < a href = " http : / / reactivex . io / documentation / operators / timeout . html " > ReactiveX operators documentation : Timeout < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public final Flowable < T > timeout ( long timeout , TimeUnit timeUnit ) { } }

implementation: return timeout0 ( timeout , timeUnit , null , Schedulers . computation ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that mirrors the source Publisher but applies a timeout policy for each emitted
 * item , where this policy is governed by a specified Scheduler . If the next item isn ' t emitted within the
 * specified timeout duration starting from its predecessor , the resulting Publisher terminates and
 * notifies Subscribers of a { @ code TimeoutException } .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / timeout . 1s . 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 > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param timeout
 * maximum duration between items before a timeout occurs
 * @ param timeUnit
 * the unit of time that applies to the { @ code timeout } argument
 * @ param scheduler
 * the Scheduler to run the timeout timers on
 * @ return the source Publisher modified to notify Subscribers of a { @ code TimeoutException } in case of a
 * timeout
 * @ see < a href = " http : / / reactivex . io / documentation / operators / timeout . html " > ReactiveX operators documentation : Timeout < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > timeout ( long timeout , TimeUnit timeUnit , Scheduler scheduler ) { } }

implementation: return timeout0 ( timeout , timeUnit , null , scheduler ) ;


signature:
public class Flowable { /** * Returns a Flowable that mirrors the source Publisher , but notifies Subscribers of a
 * { @ code TimeoutException } if either the first item emitted by the source Publisher or any subsequent item
 * doesn ' t arrive within time windows defined by other Publishers .
 * < img width = " 640 " height = " 400 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / timeout5 . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . Both this and the returned { @ code Publisher } s
 * are expected to honor backpressure as well . If any of then violates this rule , it < em > may < / em > throw an
 * { @ code IllegalStateException } when the { @ code Publisher } completes . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code timeout } does not operate by default on any { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < U >
 * the first timeout value type ( ignored )
 * @ param < V >
 * the subsequent timeout value type ( ignored )
 * @ param firstTimeoutIndicator
 * a function that returns a Publisher that determines the timeout window for the first source
 * item
 * @ param itemTimeoutIndicator
 * a function that returns a Publisher for each item emitted by the source Publisher and that
 * determines the timeout window in which the subsequent source item must arrive in order to
 * continue the sequence
 * @ return a Flowable that mirrors the source Publisher , but notifies Subscribers of a
 * { @ code TimeoutException } if either the first item or any subsequent item doesn ' t arrive within
 * the time windows specified by the timeout selectors
 * @ see < a href = " http : / / reactivex . io / documentation / operators / timeout . html " > ReactiveX operators documentation : Timeout < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U , V > Flowable < T > timeout ( Publisher < U > firstTimeoutIndicator , Function < ? super T , ? extends Publisher < V > > itemTimeoutIndicator ) { } }

implementation: ObjectHelper . requireNonNull ( firstTimeoutIndicator , "firstTimeoutIndicator is null" ) ; return timeout0 ( firstTimeoutIndicator , itemTimeoutIndicator , null ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits each item emitted by the source Publisher , wrapped in a
 * { @ link Timed } object whose timestamps are provided by a specified Scheduler .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / timestamp . s . 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 operator does not operate on any particular scheduler but uses the current time
 * from the specified { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param scheduler
 * the { @ link Scheduler } to use as a time source
 * @ return a Flowable that emits timestamped items from the source Publisher with timestamps provided by
 * the { @ code scheduler }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / timestamp . html " > ReactiveX operators documentation : Timestamp < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) // Supplied scheduler is only used for creating timestamps .
public final Flowable < Timed < T > > timestamp ( Scheduler scheduler ) { } }

implementation: return timestamp ( TimeUnit . MILLISECONDS , scheduler ) ;


signature:
public class Flowable { /** * Calls the specified converter function during assembly time and returns its resulting value .
 * This allows fluent conversion to any other type .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The backpressure behavior depends on what happens in the { @ code converter } function . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code to } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R > the resulting object type
 * @ param converter the function that receives the current Flowable instance and returns a value
 * @ return the value returned by the function */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . SPECIAL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > R to ( Function < ? super Flowable < T > , R > converter ) { } }

implementation: try { return ObjectHelper . requireNonNull ( converter , "converter is null" ) . apply ( this ) ; } catch ( Throwable ex ) { Exceptions . throwIfFatal ( ex ) ; throw ExceptionHelper . wrapOrThrow ( ex ) ; }


signature:
public class Flowable { /** * Returns a Single that emits a single item , a list composed of all the items emitted by the
 * finite upstream source Publisher .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toList . png " alt = " " >
 * Normally , a Publisher that returns multiple items will do so by invoking its { @ link Subscriber } ' s
 * { @ link Subscriber # onNext onNext } method for each such item . You can change this behavior , instructing the
 * Publisher to compose a list of all of these items and then to invoke the Subscriber ' s { @ code onNext }
 * function once , passing it the entire list , by calling the Publisher ' s { @ code toList } method prior to
 * calling its { @ link # subscribe } method .
 * Note that this operator requires the upstream to signal { @ code onComplete } for the accumulated list 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 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 toList } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Single that emits a single item : a List containing all of the items emitted by the source
 * Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / to . html " > ReactiveX operators documentation : To < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < List < T > > toList ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( new FlowableToListSingle < T , List < T > > ( this ) ) ;


signature:
public class Flowable { /** * Returns a Single that emits a single item , a list composed of all the items emitted by the
 * finite source Publisher .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toList . png " alt = " " >
 * Normally , a Publisher that returns multiple items will do so by invoking its { @ link Subscriber } ' s
 * { @ link Subscriber # onNext onNext } method for each such item . You can change this behavior , instructing the
 * Publisher to compose a list of all of these items and then to invoke the Subscriber ' s { @ code onNext }
 * function once , passing it the entire list , by calling the Publisher ' s { @ code toList } method prior to
 * calling its { @ link # subscribe } method .
 * Note that this operator requires the upstream to signal { @ code onComplete } for the accumulated list 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 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 toList } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param capacityHint
 * the number of elements expected from the current Flowable
 * @ return a Flowable that emits a single item : a List containing all of the items emitted by the source
 * Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / to . html " > ReactiveX operators documentation : To < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < List < T > > toList ( final int capacityHint ) { } }

implementation: ObjectHelper . verifyPositive ( capacityHint , "capacityHint" ) ; return RxJavaPlugins . onAssembly ( new FlowableToListSingle < T , List < T > > ( this , Functions . < T > createArrayList ( capacityHint ) ) ) ;


signature:
public class Flowable { /** * Returns a Single that emits a single item , a list composed of all the items emitted by the
 * finite source Publisher .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toList . png " alt = " " >
 * Normally , a Publisher that returns multiple items will do so by invoking its { @ link Subscriber } ' s
 * { @ link Subscriber # onNext onNext } method for each such item . You can change this behavior , instructing the
 * Publisher to compose a list of all of these items and then to invoke the Subscriber ' s { @ code onNext }
 * function once , passing it the entire list , by calling the Publisher ' s { @ code toList } method prior to
 * calling its { @ link # subscribe } method .
 * Note that this operator requires the upstream to signal { @ code onComplete } for the accumulated collection 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 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 toList } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < U > the subclass of a collection of Ts
 * @ param collectionSupplier
 * the Callable returning the collection ( for each individual Subscriber ) to be filled in
 * @ return a Single that emits a single item : a List containing all of the items emitted by the source
 * Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / to . html " > ReactiveX operators documentation : To < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U extends Collection < ? super T > > Single < U > toList ( Callable < U > collectionSupplier ) { } }

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


signature:
public class Flowable { /** * Returns a Single that emits a single Map , returned by a specified { @ code mapFactory } function , that
 * contains a custom collection of values , extracted by a specified { @ code valueSelector } function from
 * items emitted by the finite source Publisher , and keyed by the { @ code keySelector } function .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toMultiMap . png " alt = " " >
 * Note that this operator requires the upstream to signal { @ code onComplete } for the accumulated map 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 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 toMultimap } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < K > the key type of the Map
 * @ param < V > the value type of the Map
 * @ param keySelector
 * the function that extracts a key from the source items to be used as the key in the Map
 * @ param valueSelector
 * the function that extracts a value from the source items to be used as the value in the Map
 * @ param mapSupplier
 * the function that returns a Map instance to be used
 * @ param collectionFactory
 * the function that returns a Collection instance for a particular key to be used in the Map
 * @ return a Single that emits a single item : a Map that contains the collection of mapped items from
 * the source Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / to . html " > ReactiveX operators documentation : To < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K , V > Single < Map < K , Collection < V > > > toMultimap ( final Function < ? super T , ? extends K > keySelector , final Function < ? super T , ? extends V > valueSelector , final Callable < ? extends Map < K , Collection < V > > > mapSupplier , final Function < ? super K , ? extends Collection < ? super V > > collectionFactory ) { } }

implementation: ObjectHelper . requireNonNull ( keySelector , "keySelector is null" ) ; ObjectHelper . requireNonNull ( valueSelector , "valueSelector is null" ) ; ObjectHelper . requireNonNull ( mapSupplier , "mapSupplier is null" ) ; ObjectHelper . requireNonNull ( collectionFactory , "collectionFactory is null" ) ; return collect ( mapSupplier , Functions . toMultimapKeyValueSelector ( keySelector , valueSelector , collectionFactory ) ) ;


signature:
public class Flowable { /** * Converts the current Flowable into a non - backpressured { @ link Observable } .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > Observables don ' t support backpressure thus the current Flowable is consumed in an unbounded
 * manner ( by requesting Long . MAX _ VALUE ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code toObservable } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the new Observable instance
 * @ since 2.0 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > toObservable ( ) { } }

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


signature:
public class Flowable { /** * Returns a Single that emits a list that contains the items emitted by the finite 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 } .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toSortedList . png " alt = " " >
 * Note that this operator requires the upstream to signal { @ code onComplete } for the accumulated list 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 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 toSortedList } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Single that emits a list that contains the items emitted by the source Publisher in
 * sorted order
 * @ see < a href = " http : / / reactivex . io / documentation / operators / to . html " > ReactiveX operators documentation : To < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < List < T > > toSortedList ( ) { } }

implementation: return toSortedList ( Functions . naturalComparator ( ) ) ;


signature:
public class Flowable { /** * Modifies the source Publisher so that subscribers will cancel it on a specified
 * { @ link Scheduler } .
 * < 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 > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param scheduler
 * the { @ link Scheduler } to perform cancellation actions on
 * @ return the source Publisher modified so that its cancellations happen on the specified
 * { @ link Scheduler }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / subscribeon . html " > ReactiveX operators documentation : SubscribeOn < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > unsubscribeOn ( Scheduler scheduler ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that emits windows of items it collects from the source Publisher . The resulting
 * Publisher emits connected , non - overlapping windows , each containing { @ code count } items . When the source
 * Publisher completes or encounters an error , the resulting Publisher emits the current window and
 * propagates the notification from the source Publisher .
 * < img width = " 640 " height = " 400 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / window3 . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure of its inner and outer subscribers , however , the inner Publisher uses an
 * unbounded buffer that may hold at most { @ code count } elements . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code window } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param count
 * the maximum size of each window before it should be emitted
 * @ return a Flowable that emits connected , non - overlapping windows , each containing at most
 * { @ code count } items from the source Publisher
 * @ throws IllegalArgumentException if either count is non - positive
 * @ see < a href = " http : / / reactivex . io / documentation / operators / window . html " > ReactiveX operators documentation : Window < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < Flowable < T > > window ( long count ) { } }

implementation: return window ( count , count , bufferSize ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits windows of items it collects from the source Publisher . The resulting
 * Publisher emits windows every { @ code skip } items , each containing no more than { @ code count } items . When
 * the source Publisher completes or encounters an error , the resulting Publisher emits the current window
 * and propagates the notification from the source Publisher .
 * < img width = " 640 " height = " 365 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / window4 . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure of its inner and outer subscribers , however , the inner Publisher uses an
 * unbounded buffer that may hold at most { @ code count } elements . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code window } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param count
 * the maximum size of each window before it should be emitted
 * @ param skip
 * how many items need to be skipped before starting a new window . Note that if { @ code skip } and
 * { @ code count } are equal this is the same operation as { @ link # window ( long ) } .
 * @ param bufferSize
 * the capacity hint for the buffer in the inner windows
 * @ return a Flowable that emits windows every { @ code skip } items containing at most { @ code count } items
 * from the source Publisher
 * @ throws IllegalArgumentException if either count or skip is non - positive
 * @ see < a href = " http : / / reactivex . io / documentation / operators / window . html " > ReactiveX operators documentation : Window < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < Flowable < T > > window ( long count , long skip , int bufferSize ) { } }

implementation: ObjectHelper . verifyPositive ( skip , "skip" ) ; ObjectHelper . verifyPositive ( count , "count" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return RxJavaPlugins . onAssembly ( new FlowableWindow < T > ( this , count , skip , bufferSize ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits windows of items it collects from the source Publisher . The resulting
 * Publisher starts a new window periodically , as determined by the { @ code timeskip } argument . It emits
 * each window after a fixed timespan , specified by the { @ code timespan } argument . When the source
 * Publisher completes or Publisher completes or encounters an error , the resulting Publisher emits the
 * current window and propagates the notification from the source Publisher .
 * < img width = " 640 " height = " 335 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / window7 . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the source { @ code Publisher } in an unbounded manner .
 * The returned { @ code Publisher } doesn ' t support backpressure as it uses
 * time to control the creation of windows . The returned inner { @ code Publisher } s honor
 * backpressure but have an unbounded inner buffer that < em > may < / em > lead to { @ code OutOfMemoryError }
 * if left unconsumed . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code window } operates by default on the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param timespan
 * the period of time each window collects items before it should be emitted
 * @ param timeskip
 * the period of time after which a new window will be created
 * @ param unit
 * the unit of time that applies to the { @ code timespan } and { @ code timeskip } arguments
 * @ return a Flowable that emits new windows periodically as a fixed timespan elapses
 * @ see < a href = " http : / / reactivex . io / documentation / operators / window . html " > ReactiveX operators documentation : Window < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public final Flowable < Flowable < T > > window ( long timespan , long timeskip , TimeUnit unit ) { } }

implementation: return window ( timespan , timeskip , unit , Schedulers . computation ( ) , bufferSize ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits windows of items it collects from the source Publisher . The resulting
 * Publisher emits connected , non - overlapping windows , each of a fixed duration as specified by the
 * { @ code timespan } argument or a maximum size as specified by the { @ code count } argument ( whichever is
 * reached first ) . When the source Publisher completes or encounters an error , the resulting Publisher
 * emits the current window and propagates the notification from the source Publisher .
 * < img width = " 640 " height = " 370 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / window6 . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the source { @ code Publisher } in an unbounded manner .
 * The returned { @ code Publisher } doesn ' t support backpressure as it uses
 * time to control the creation of windows . The returned inner { @ code Publisher } s honor
 * backpressure and may hold up to { @ code count } elements at most . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code window } operates by default on the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param timespan
 * the period of time each window collects items before it should be emitted and replaced with a
 * new window
 * @ param unit
 * the unit of time that applies to the { @ code timespan } argument
 * @ param count
 * the maximum size of each window before it should be emitted
 * @ return a Flowable that emits connected , non - overlapping windows of items from the source Publisher
 * that were emitted during a fixed duration of time or when the window has reached maximum capacity
 * ( whichever occurs first )
 * @ see < a href = " http : / / reactivex . io / documentation / operators / window . html " > ReactiveX operators documentation : Window < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public final Flowable < Flowable < T > > window ( long timespan , TimeUnit unit , long count ) { } }

implementation: return window ( timespan , unit , Schedulers . computation ( ) , count , false ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits windows of items it collects from the source Publisher . The resulting
 * Publisher emits connected , non - overlapping windows , each of a fixed duration as specified by the
 * { @ code timespan } argument . When the source Publisher completes or encounters an error , the resulting
 * Publisher emits the current window and propagates the notification from the source Publisher .
 * < img width = " 640 " height = " 375 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / window5 . s . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the source { @ code Publisher } in an unbounded manner .
 * The returned { @ code Publisher } doesn ' t support backpressure as it uses
 * time to control the creation of windows . The returned inner { @ code Publisher } s honor
 * backpressure but have an unbounded inner buffer that < em > may < / em > lead to { @ code OutOfMemoryError }
 * if left unconsumed . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param timespan
 * the period of time each window collects items before it should be emitted and replaced with a
 * new window
 * @ param unit
 * the unit of time which applies to the { @ code timespan } argument
 * @ param scheduler
 * the { @ link Scheduler } to use when determining the end and start of a window
 * @ return a Flowable that emits connected , non - overlapping windows containing items emitted by the
 * source Publisher within a fixed duration
 * @ see < a href = " http : / / reactivex . io / documentation / operators / window . html " > ReactiveX operators documentation : Window < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < Flowable < T > > window ( long timespan , TimeUnit unit , Scheduler scheduler ) { } }

implementation: return window ( timespan , unit , scheduler , Long . MAX_VALUE , false ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits windows of items it collects from the source Publisher . The resulting
 * Publisher emits windows that contain those items emitted by the source Publisher between the time when
 * the { @ code windowOpenings } Publisher emits an item and when the Publisher returned by
 * { @ code closingSelector } emits an item .
 * < img width = " 640 " height = " 550 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / window2 . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The outer Publisher of this operator doesn ' t support backpressure because the emission of new
 * inner Publishers are controlled by the { @ code windowOpenings } Publisher .
 * The inner Publishers honor backpressure and buffer everything until the associated closing
 * Publisher signals or completes . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code window } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < U > the element type of the window - opening Publisher
 * @ param < V > the element type of the window - closing Publishers
 * @ param openingIndicator
 * a Publisher that , when it emits an item , causes another window to be created
 * @ param closingIndicator
 * a { @ link Function } that produces a Publisher for every window created . When this Publisher
 * emits an item , the associated window is closed and emitted
 * @ return a Flowable that emits windows of items emitted by the source Publisher that are governed by
 * the specified window - governing Publishers
 * @ see < a href = " http : / / reactivex . io / documentation / operators / window . html " > ReactiveX operators documentation : Window < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U , V > Flowable < Flowable < T > > window ( Publisher < U > openingIndicator , Function < ? super U , ? extends Publisher < V > > closingIndicator ) { } }

implementation: return window ( openingIndicator , closingIndicator , bufferSize ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits windows of items it collects from the source Publisher . The resulting
 * Publisher emits windows that contain those items emitted by the source Publisher between the time when
 * the { @ code windowOpenings } Publisher emits an item and when the Publisher returned by
 * { @ code closingSelector } emits an item .
 * < img width = " 640 " height = " 550 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / window2 . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The outer Publisher of this operator doesn ' t support backpressure because the emission of new
 * inner Publishers are controlled by the { @ code windowOpenings } Publisher .
 * The inner Publishers honor backpressure and buffer everything until the associated closing
 * Publisher signals or completes . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code window } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < U > the element type of the window - opening Publisher
 * @ param < V > the element type of the window - closing Publishers
 * @ param openingIndicator
 * a Publisher that , when it emits an item , causes another window to be created
 * @ param closingIndicator
 * a { @ link Function } that produces a Publisher for every window created . When this Publisher
 * emits an item , the associated window is closed and emitted
 * @ param bufferSize
 * the capacity hint for the buffer in the inner windows
 * @ return a Flowable that emits windows of items emitted by the source Publisher that are governed by
 * the specified window - governing Publishers
 * @ see < a href = " http : / / reactivex . io / documentation / operators / window . html " > ReactiveX operators documentation : Window < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U , V > Flowable < Flowable < T > > window ( Publisher < U > openingIndicator , Function < ? super U , ? extends Publisher < V > > closingIndicator , int bufferSize ) { } }

implementation: ObjectHelper . requireNonNull ( openingIndicator , "openingIndicator is null" ) ; ObjectHelper . requireNonNull ( closingIndicator , "closingIndicator is null" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return RxJavaPlugins . onAssembly ( new FlowableWindowBoundarySelector < T , U , V > ( this , openingIndicator , closingIndicator , bufferSize ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits windows of items it collects from the source Publisher . The resulting
 * Publisher emits connected , non - overlapping windows . It emits the current window and opens a new one
 * whenever the Publisher produced by the specified { @ code closingSelector } emits an item .
 * < img width = " 640 " height = " 455 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / window1 . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the source { @ code Publisher } in an unbounded manner .
 * The returned { @ code Publisher } doesn ' t support backpressure as it uses
 * the { @ code closingSelector } to control the creation of windows . The returned inner { @ code Publisher } s honor
 * backpressure but have an unbounded inner buffer that < em > may < / em > lead to { @ code OutOfMemoryError }
 * if left unconsumed . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code window } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < B > the element type of the boundary Publisher
 * @ param boundaryIndicatorSupplier
 * a { @ link Callable } that returns a { @ code Publisher } that governs the boundary between windows .
 * When the source { @ code Publisher } emits an item , { @ code window } emits the current window and begins
 * a new one .
 * @ return a Flowable that emits connected , non - overlapping windows of items from the source Publisher
 * whenever { @ code closingSelector } emits an item
 * @ see < a href = " http : / / reactivex . io / documentation / operators / window . html " > ReactiveX operators documentation : Window < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < B > Flowable < Flowable < T > > window ( Callable < ? extends Publisher < B > > boundaryIndicatorSupplier ) { } }

implementation: return window ( boundaryIndicatorSupplier , bufferSize ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits windows of items it collects from the source Publisher . The resulting
 * Publisher emits connected , non - overlapping windows . It emits the current window and opens a new one
 * whenever the Publisher produced by the specified { @ code closingSelector } emits an item .
 * < img width = " 640 " height = " 455 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / window1 . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the source { @ code Publisher } in an unbounded manner .
 * The returned { @ code Publisher } doesn ' t support backpressure as it uses
 * the { @ code closingSelector } to control the creation of windows . The returned inner { @ code Publisher } s honor
 * backpressure but have an unbounded inner buffer that < em > may < / em > lead to { @ code OutOfMemoryError }
 * if left unconsumed . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code window } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < B > the element type of the boundary Publisher
 * @ param boundaryIndicatorSupplier
 * a { @ link Callable } that returns a { @ code Publisher } that governs the boundary between windows .
 * When the source { @ code Publisher } emits an item , { @ code window } emits the current window and begins
 * a new one .
 * @ param bufferSize
 * the capacity hint for the buffer in the inner windows
 * @ return a Flowable that emits connected , non - overlapping windows of items from the source Publisher
 * whenever { @ code closingSelector } emits an item
 * @ see < a href = " http : / / reactivex . io / documentation / operators / window . html " > ReactiveX operators documentation : Window < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < B > Flowable < Flowable < T > > window ( Callable < ? extends Publisher < B > > boundaryIndicatorSupplier , int bufferSize ) { } }

implementation: ObjectHelper . requireNonNull ( boundaryIndicatorSupplier , "boundaryIndicatorSupplier is null" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return RxJavaPlugins . onAssembly ( new FlowableWindowBoundarySupplier < T , B > ( this , boundaryIndicatorSupplier , bufferSize ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits items that are the result of applying a specified function to pairs of
 * values , one each from the source Publisher and a specified Iterable sequence .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / zip . i . png " alt = " " >
 * Note that the { @ code other } Iterable is evaluated as items are observed from the source Publisher ; it is
 * not pre - consumed . This allows you to zip infinite streams on either side .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator expects backpressure from the sources and honors backpressure from the downstream .
 * ( I . e . , zipping with { @ link # interval ( long , TimeUnit ) } may result in MissingBackpressureException , use
 * one of the { @ code onBackpressureX } to handle similar , backpressure - ignoring sources . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code zipWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < U >
 * the type of items in the { @ code other } Iterable
 * @ param < R >
 * the type of items emitted by the resulting Publisher
 * @ param other
 * the Iterable sequence
 * @ param zipper
 * a function that combines the pairs of items from the Publisher and the Iterable to generate
 * the items to be emitted by the resulting Publisher
 * @ return a Flowable that pairs up values from the source Publisher and the { @ code other } Iterable
 * sequence and emits the results of { @ code zipFunction } applied to these pairs
 * @ see < a href = " http : / / reactivex . io / documentation / operators / zip . html " > ReactiveX operators documentation : Zip < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U , R > Flowable < R > zipWith ( Iterable < U > other , BiFunction < ? super T , ? super U , ? extends R > zipper ) { } }

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


signature:
public class Flowable { /** * Returns a Flowable that emits items that are the result of applying a specified function to pairs of
 * values , one each from the source Publisher and another specified Publisher .
 * The operator subscribes to its sources in the order they are specified and completes eagerly if
 * one of the sources is shorter than the rest while canceling the other sources . Therefore , it
 * is possible those other sources will never be able to run to completion ( and thus not calling
 * { @ code doOnComplete ( ) } ) . This can also happen if the sources are exactly the same length ; if
 * source A completes and B has been consumed and is about to complete , the operator detects A won ' t
 * be sending further values and it will cancel B immediately . For example :
 * < pre > < code > range ( 1 , 5 ) . doOnComplete ( action1 ) . zipWith ( range ( 6 , 5 ) . doOnComplete ( action2 ) , ( a , b ) - & gt ; a + b ) < / code > < / pre >
 * { @ code action1 } will be called but { @ code action2 } won ' t .
 * < br > To work around this termination property ,
 * use { @ link # doOnCancel ( Action ) } as well or use { @ code using ( ) } to do cleanup in case of completion
 * or cancellation .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / zip . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator expects backpressure from the sources and honors backpressure from the downstream .
 * ( I . e . , zipping with { @ link # interval ( long , TimeUnit ) } may result in MissingBackpressureException , use
 * one of the { @ code onBackpressureX } to handle similar , backpressure - ignoring sources . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code zipWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < U >
 * the type of items emitted by the { @ code other } Publisher
 * @ param < R >
 * the type of items emitted by the resulting Publisher
 * @ param other
 * the other Publisher
 * @ param zipper
 * a function that combines the pairs of items from the two Publishers to generate the items to
 * be emitted by the resulting Publisher
 * @ param delayError
 * if true , errors from the current Flowable or the other Publisher is delayed until both terminate
 * @ return a Flowable that pairs up values from the source Publisher and the { @ code other } Publisher
 * and emits the results of { @ code zipFunction } applied to these pairs
 * @ see < a href = " http : / / reactivex . io / documentation / operators / zip . html " > ReactiveX operators documentation : Zip < / a >
 * @ since 2.0 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U , R > Flowable < R > zipWith ( Publisher < ? extends U > other , BiFunction < ? super T , ? super U , ? extends R > zipper , boolean delayError ) { } }

implementation: return zip ( this , other , zipper , delayError ) ;


signature:
public class MpscLinkedQueue { /** * { @ inheritDoc } < br >
 * IMPLEMENTATION NOTES : < br >
 * Offer is allowed from multiple threads . < br >
 * Offer allocates a new node and :
 * < ol >
 * < li > Swaps it atomically with current producer node ( only one producer ' wins ' )
 * < li > Sets the new node as the node following from the swapped producer node
 * < / ol >
 * This works because each producer is guaranteed to ' plant ' a new node and link the old node . No 2 producers can
 * get the same producer node as part of XCHG guarantee .
 * @ see java . util . Queue # offer ( java . lang . Object ) */
@ Override public boolean offer ( final T e ) { } }

implementation:
if ( null == e ) { throw new NullPointerException ( "Null is not a valid element" ) ; } final LinkedQueueNode < T > nextNode = new LinkedQueueNode < T > ( e ) ; final LinkedQueueNode < T > prevProducerNode = xchgProducerNode ( nextNode ) ; // Should a producer thread get interrupted here the chain WILL be broken until that thread is resumed
// and completes the store in prev . next .
prevProducerNode . soNext ( nextNode ) ; // StoreStore
return true ;


signature:
public class MpscLinkedQueue { /** * { @ inheritDoc } < br >
 * IMPLEMENTATION NOTES : < br >
 * Poll is allowed from a SINGLE thread . < br >
 * Poll reads the next node from the consumerNode and :
 * < ol >
 * < li > If it is null , the queue is assumed empty ( though it might not be ) .
 * < li > If it is not null set it as the consumer node and return it ' s now evacuated value .
 * < / ol >
 * This means the consumerNode . value is always null , which is also the starting point for the queue . Because null
 * values are not allowed to be offered this is the only node with it ' s value set to null at any one time .
 * @ see java . util . Queue # poll ( ) */
@ Nullable @ Override public T poll ( ) { } }

implementation:
LinkedQueueNode < T > currConsumerNode = lpConsumerNode ( ) ; // don ' t load twice , it ' s alright
LinkedQueueNode < T > nextNode = currConsumerNode . lvNext ( ) ; if ( nextNode != null ) { // we have to null out the value because we are going to hang on to the node
final T nextValue = nextNode . getAndNullValue ( ) ; spConsumerNode ( nextNode ) ; return nextValue ; } else if ( currConsumerNode != lvProducerNode ( ) ) { // spin , we are no longer wait free
while ( ( nextNode = currConsumerNode . lvNext ( ) ) == null ) { } // NOPMD
// got the next node . . .
// we have to null out the value because we are going to hang on to the node
final T nextValue = nextNode . getAndNullValue ( ) ; spConsumerNode ( nextNode ) ; return nextValue ; } return null ;


signature:
public class NewThreadWorker { /** * Wraps the given runnable into a ScheduledRunnable and schedules it
 * on the underlying ScheduledExecutorService .
 * < p > If the schedule has been rejected , the ScheduledRunnable . wasScheduled will return
 * false .
 * @ param run the runnable instance
 * @ param delayTime the time to delay the execution
 * @ param unit the time unit
 * @ param parent the optional tracker parent to add the created ScheduledRunnable instance to before it gets scheduled
 * @ return the ScheduledRunnable instance */
@ NonNull public ScheduledRunnable scheduleActual ( final Runnable run , long delayTime , @ NonNull TimeUnit unit , @ Nullable DisposableContainer parent ) { } }

implementation: Runnable decoratedRun = RxJavaPlugins . onSchedule ( run ) ; ScheduledRunnable sr = new ScheduledRunnable ( decoratedRun , parent ) ; if ( parent != null ) { if ( ! parent . add ( sr ) ) { return sr ; } } Future < ? > f ; try { if ( delayTime <= 0 ) { f = executor . submit ( ( Callable < Object > ) sr ) ; } else { f = executor . schedule ( ( Callable < Object > ) sr , delayTime , unit ) ; } sr . setFuture ( f ) ; } catch ( RejectedExecutionException ex ) { if ( parent != null ) { parent . remove ( sr ) ; } RxJavaPlugins . onError ( ex ) ; } return sr ;


signature:
public class PerfAsyncConsumer { /** * Wait for the terminal signal .
 * @ param count if less than 1001 , a spin - wait is used
 * @ return this */
public PerfAsyncConsumer await ( int count ) { } }

implementation: if ( count <= 1000 ) { while ( getCount ( ) != 0 ) { } } else { try { await ( ) ; } catch ( InterruptedException ex ) { throw new RuntimeException ( ex ) ; } } return this ;


signature:
public class DeferredScalarSubscription { /** * Completes this subscription by indicating the given value should
 * be emitted when the first request arrives .
 * < p > Make sure this is called exactly once .
 * @ param v the value to signal , not null ( not validated ) */
public final void complete ( T v ) { } }

implementation:
int state = get ( ) ; for ( ; ; ) { if ( state == FUSED_EMPTY ) { value = v ; lazySet ( FUSED_READY ) ; Subscriber < ? super T > a = downstream ; a . onNext ( v ) ; if ( get ( ) != CANCELLED ) { a . onComplete ( ) ; } return ; } // if state is > = CANCELLED or bit zero is set ( * _ HAS _ VALUE ) case , return
if ( ( state & ~ HAS_REQUEST_NO_VALUE ) != 0 ) { return ; } if ( state == HAS_REQUEST_NO_VALUE ) { lazySet ( HAS_REQUEST_HAS_VALUE ) ; Subscriber < ? super T > a = downstream ; a . onNext ( v ) ; if ( get ( ) != CANCELLED ) { a . onComplete ( ) ; } return ; } value = v ; if ( compareAndSet ( NO_REQUEST_NO_VALUE , NO_REQUEST_HAS_VALUE ) ) { return ; } state = get ( ) ; if ( state == CANCELLED ) { value = null ; return ; } }


signature:
public class BehaviorProcessor { /** * Creates a { @ link BehaviorProcessor } that emits the last item it observed and all subsequent items to each
 * { @ link Subscriber } that subscribes to it .
 * @ param < T >
 * the type of item the BehaviorProcessor will emit
 * @ param defaultValue
 * the item that will be emitted first to any { @ link Subscriber } as long as the
 * { @ link BehaviorProcessor } has not yet observed any items from its source { @ code Observable }
 * @ return the constructed { @ link BehaviorProcessor } */
@ CheckReturnValue @ NonNull public static < T > BehaviorProcessor < T > createDefault ( T defaultValue ) { } }

implementation: ObjectHelper . requireNonNull ( defaultValue , "defaultValue is null" ) ; return new BehaviorProcessor < T > ( defaultValue ) ;


signature:
public class BehaviorProcessor { /** * Tries to emit the item to all currently subscribed Subscribers if all of them
 * has requested some value , returns false otherwise .
 * This method should be called in a sequential manner just like the onXXX methods
 * of the PublishProcessor .
 * Calling with null will terminate the PublishProcessor and a NullPointerException
 * is signalled to the Subscribers .
 * < p > History : 2.0.8 - experimental
 * @ param t the item to emit , not null
 * @ return true if the item was emitted to all Subscribers
 * @ since 2.2 */
public boolean offer ( T t ) { } }

implementation: if ( t == null ) { onError ( new NullPointerException ( "onNext called with null. Null values are generally not allowed in 2.x operators and sources." ) ) ; return true ; } BehaviorSubscription < T > [ ] array = subscribers . get ( ) ; for ( BehaviorSubscription < T > s : array ) { if ( s . isFull ( ) ) { return false ; } } Object o = NotificationLite . next ( t ) ; setCurrent ( o ) ; for ( BehaviorSubscription < T > bs : array ) { bs . emitNext ( o , index ) ; } return true ;


signature:
public class FlowableLastMaybe { /** * TODO fuse back to Flowable */
@ Override protected void subscribeActual ( MaybeObserver < ? super T > observer ) { } }

implementation: source . subscribe ( new LastSubscriber < T > ( observer ) ) ;


signature:
public class BlockingHelper { /** * Checks if the { @ code failOnNonBlockingScheduler } plugin setting is enabled and the current
 * thread is a Scheduler sensitive to blocking operators .
 * @ throws IllegalStateException if the { @ code failOnNonBlockingScheduler } and the current thread is sensitive to blocking */
public static void verifyNonBlocking ( ) { } }

implementation: if ( RxJavaPlugins . isFailOnNonBlockingScheduler ( ) && ( Thread . currentThread ( ) instanceof NonBlockingThread || RxJavaPlugins . onBeforeBlocking ( ) ) ) { throw new IllegalStateException ( "Attempt to block on a Scheduler " + Thread . currentThread ( ) . getName ( ) + " that doesn't support blocking operators as they may lead to deadlock" ) ; }


signature:
public class ConnectableFlowable { /** * Returns a { @ code Flowable } that stays connected to this { @ code ConnectableFlowable } as long as there
 * is at least one subscription to this { @ code ConnectableFlowable } .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator itself doesn ' t interfere with backpressure which is determined by the upstream
 * { @ code ConnectableFlowable } ' s backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This { @ code refCount } overload does not operate on any particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a { @ link Flowable }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / refcount . html " > ReactiveX documentation : RefCount < / a >
 * @ see # refCount ( int )
 * @ see # refCount ( long , TimeUnit )
 * @ see # refCount ( int , long , TimeUnit ) */
@ NonNull @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) public Flowable < T > refCount ( ) { } }

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