Package rx.internal.operators
package rx.internal.operators
Operators that allow composing Observables to transform and manipulate data in an asynchronous, functional and thread-safe manner.
The operators are all exposed via the ObservableExtensions class
-
ClassDescriptionUtility functions for use with backpressure.Wait for and iterate over the latest values of the source observable.Observer of source, iterator for output.Returns an Iterable that always returns the item most recently emitted by an Observable, or a seed value if no item has yet been emitted.Returns an Iterable that blocks until the Observable emits another item, then returns that item.Returns a Future representing the single value emitted by an Observable.Returns an Iterator that iterates over all items emitted by a specified Observable.A solution to the "time gap" problem that occurs with
groupBy
andpivot
.The common state.An observable which auto-connects to another observable, caches the elements from that observable but allows terminating the connection and completing the cache.Manages the subscription of child subscribers by setting up a replay producer and performs auto-connection of the very first subscription.Contains the active child producers and the values to replay.Keeps track of the current request amount and the replay position for a child Subscriber.Base class for Subscribers that consume the entire upstream and signal zero or one element (or an error) in a backpressure honoring fashion.Redirects the downstream request amount bach to the DeferredScalarSubscriber.Holds a singleton instance of an empty Observable which is stateless and completes the child subscriber immediately.Holds a singleton instance of a never Observable which is stateless doesn't call any of the Subscriber's methods.For use in internal operators that need something like materialize and dematerialize wholly within the implementation of the operator but don't want to incur the allocation cost of actually creatingNotification
objects for everyonNext
andonCompleted
.Given multipleObservable
s, propagates the one that first emits an item.Wraps a ConnectableObservable and calls its connect() method once the specified number of Subscribers have subscribed.OnSubscribeCollect<T,R> OnSubscribeConcatMap<T,R> Maps a source sequence into Observables and concatenates them in order, subscribing to one at a time.Do not create the Observable until an Observer subscribes; create a fresh Observable on each subscription.Delays the subscription to the source by the given amount, running on the given scheduler.Delays the subscription to the main source until the other observable fires an event or completes.Delays the subscription until the Observable emits an event.Nulls out references to upstream data structures when the source terminates or the child unsubscribes.Callbacks from the child Subscriber.The parent subscriber that forwards events and cleans up on a terminal state.Singleton instance via enum.Filters an Observable by discarding any items it emits that do not meet some test.Flattens a sequence if Iterable sources, generated via a function, into a single sequence.A custom flattener that works from a scalar value and computes the iterable during subscription time.Do not invoke the function until an Observer subscribes; Invokes function on each subscription.Converts anIterable
sequence into anObservable
.OnSubscribeGroupJoin<T1,T2, D1, D2, R> Correlates two sequences when they overlap and groups the results.The reference-counted window observable.OnSubscribeJoin<TLeft,TRight, TLeftDuration, TRightDuration, R> Correlates the elements of two sequences based on overlapping durations.OnSubscribeLift<T,R> Transforms the downstream Subscriber into a Subscriber via an operator callback and calls the parent OnSubscribe.call() method with it.OnSubscribeMap<T,R> Applies a function of your choosing to every item emitted by anObservable
, and emits the results of this transformation as a newObservable
.Captures the current stack when it is instantiated, makes it available through a field and attaches it to all passing exception.Captures the current stack when it is instantiated, makes it available through a field and attaches it to all passing exception.Captures the current stack when it is instantiated, makes it available through a field and attaches it to all passing exception.Multicasts notifications coming through its input Subscriber view to its client Subscribers via lockstep backpressure mode.The subscriber that must be used for subscribing to the upstream source.A Producer and Subscription that wraps a child Subscriber and manages its backpressure requests along with its unsubscription from the parent class.Emit ints from start to end inclusive.Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence.Allows conversion of an Observable to a Single ensuring that exactly one item is emitted - no more and no less.Timer that emits a single 0L and completes after the specified time.Emit 0L after the initial period and ever increasing number after each period.Converts aFuture
into anObservable
.OnSubscribeUsing<T,Resource> Constructs an observable sequence that depends on a resource object.OnSubscribeUsing.DisposeAction<Resource>OperatorAll<T>Returns an Observable that emits a Boolean that indicates whether all items emitted by an Observable satisfy a condition.OperatorAny<T>Returns anObservable
that emitstrue
if any element of an observable sequence satisfies a condition, otherwisefalse
.Hides the identity of another observable.Lazy initialization via inner-class holder.OperatorBufferWithSingleObservable<T,TClosing> This operation takes values from the specifiedObservable
source and stores them in a buffer until theObservable
constructed using theFunc0
argument, produces a value.This operation takes values from the specifiedObservable
source and stores them in all active chunks until the buffer contains a specified number of elements.OperatorBufferWithStartEndObservable<T,TOpening, TClosing> This operation takes values from the specifiedObservable
source and stores them in the currently active chunks.This operation takes values from the specifiedObservable
source and stores them in a buffer.OperatorCast<T,R> Converts the elements of an observable sequence to the specified type.Delay the emission via another observable if no new source appears in the meantime.This operation filters out events which are published too quickly in succession.Tracks the last value to be emitted and manages completion.Delays the emission of onNext events by a given amount of time.Delay the subscription and emission of the source items by a per-item observable that fires its first element.Reverses the effect ofOperatorMaterialize
by transforming the Notification objects emitted by a source Observable into the items or notifications they represent.Lazy initialization via inner-class holder.OperatorDistinct<T,U> Returns an Observable that emits all distinct items emitted by the source.Returns an Observable that emits all sequentially distinct items emitted by the source.Registers an action to be called after an Observable invokesonComplete
oronError
.Converts the elements of an observable sequence to the specified type.This operator modifies anObservable
so a given action is invoked when theProducer
receives a request.This operator modifies anObservable
so a given action is invoked when theObservable
is subscribed.This operator modifies anObservable
so a given action is invoked when theObservable
is unsubscribed.Returns the element at a specified index in a sequence.A producer that wraps another Producer and requests Long.MAX_VALUE when the first positive request() call comes in.OperatorGroupBy<T,K, V> Groups the items emitted by an Observable according to a specified criterion, and emits these grouped items as Observables, one Observable per group.Applies a function of your choosing to every item emitted by anObservable
, and emits the results of this transformation as a newObservable
.OperatorMapPair<T,U, R> AnObservable.Operator
that pairs up items emitted by a sourceObservable
with the sequence of items emitted by theObservable
that is derived from each item by means of a selector, and emits the results of this pairing.Turns all of the notifications from an Observable intoonNext
emissions, and marks them with their original notification types withinNotification
objects.Lazy initialization via inner-class holder.Flattens a list ofObservable
s into oneObservable
, without any transformation.Lazy initialization via inner-class holder.Lazy initialization via inner-class holder.The subscriber that observes Observables.OperatorMulticast<T,R> Shares a single subscription to a source through a Subject.Delivers events on the specifiedScheduler
asynchronously via an unbounded buffer.Observe through individual queue per observer.Lazy initialization via inner-class holder.An operator which drops all but the last received value in case the downstream doesn't request more.Holds a singleton instance initialized on class-loading.A terminable producer which emits the latest items on request.Instruct an Observable to pass control to another Observable (the return value of a function) rather than invokingonError
if it encounters an error.A connectable observable which shares an underlying source and dispatches source values to subscribers in a backpressure-aware manner.A Producer and Subscription that manages the request and unsubscription state of a child subscriber in thread-safe manner.Base class for bounded buffering with options to specify an enter and leave transforms and custom truncation behavior.A Producer and Subscription that manages the request and unsubscription state of a child subscriber in thread-safe manner.Represents a node in a bounded replay buffer's linked list.The interface for interacting with various buffering logic.Size and time bound replay buffer.A bounded replay buffer implementation with size limit only.Holds an unbounded list of events.Sample with the help of another observable.Returns an Observable that emits the results of sampling the items emitted by the source Observable at a specified time interval.The source subscriber and sampler.OperatorScan<R,T> Returns an Observable that applies a function to the first item emitted by a source Observable, then feeds the result of that function along with the second item emitted by an Observable into the same function, and so on until all items have been emitted by the source Observable, emitting the result of each of these iterations.Returns anObservable
that emits a singleBoolean
value that indicates whether two sourceObservable
s emit sequences of items that are equivalent to each other.Lazy initialization via inner-class holder.If the Observable completes after emitting a single item that matches a predicate, return an Observable containing that item.OperatorSkip<T>Returns an Observable that skips the firstnum
items emitted by the source Observable.Bypasses a specified number of elements at the end of an observable sequence.Skip delivering values in the time window before the values.Skips elements until a specified time elapses.OperatorSkipUntil<T,U> Skip elements from the source Observable until the secondary observable fires an element.Skips any emitted source items as long as the specified condition holds true.Subscribes Observers on the specifiedScheduler
.Transforms an Observable that emits Observables into a single Observable that emits the items emitted by the most recently published of those Observables.Lazy initialization via inner-class holder.Lazy initialization via inner-class holder.If the Observable completes without emitting any items, subscribe to an alternate Observable.OperatorTake<T>AnObservable
that emits the firstnum
items emitted by the sourceObservable
.Returns an Observable that emits the at most the lastcount
items emitted by the source Observable.Returns an Observable that emits the lastcount
items emitted by the source Observable.Takes values from the source until the specific time elapses.Subscribed to source and scheduled on a worker.OperatorTakeUntil<T,E> Returns an Observable that emits the items from the source Observable until another Observable emits an item.Returns an Observable that emits items emitted by the source Observable until the provided predicate returns falseO Returns an Observable that emits items emitted by the source Observable as long as a specified condition is true.Throttle by windowing a stream and returning the first value in each window.Records the time interval between consecutive elements in an observable sequence.Applies a timeout policy for each element in the observable sequence, using the specified scheduler to run timeout timers.Set up the timeout action on the first value.Set up the timeout action based on every valueOperatorTimeoutWithSelector<T,U, V> Returns an Observable that mirrors the source Observable.Wraps each item emitted by a sourceObservable
in aTimestamped
object.OperatorToMap<T,K, V> Maps the elements of the source observable into a java.util.Map instance and emits that once the source observable completes.The default map factory.OperatorToMultimap<T,K, V> Maps the elements of the source observable into a multimap (Map<K, Collection<V>>) where each key entry has a collection of the source's values.The default collection factory for a key in the multimap returning an ArrayList independent of the key.The default multimap factory returning a HashMap.Returns anObservable
that emits a single item, a list composed of all the items emitted by the sourceObservable
.Lazy initialization via inner-class holder.Return anObservable
that emits the items emitted by the sourceObservable
, in a sorted order (each item emitted by theObservable
must implementComparable
with respect to all other items in the sequence, or you must pass in a sort function).Unsubscribes on the specified Scheduler.Creates non-overlapping windows of items where each window is terminated by an event from a secondary observable and a new window is started immediately.Observes the boundary.Observes the source.Creates non-overlapping windows of items where each window is terminated by an event from a secondary observable and a new window is started immediately.Observes the boundary.Observes the source.Creates windows of values into the source sequence with skip frequency and size bounds.Creates potentially overlapping windows of the source items where each window is started by a value emitted by an observable and closed when an associated Observable emits a value or completes.Serialized access to the subject.Creates windows of values into the source sequence with timed window creation, length and size bounds.Record to store the subject and the emission count.The immutable windowing state with one subject.OperatorWithLatestFrom<T,U, R> Combines values from two sources only when the main source emits.OperatorZip<R>Returns an Observable that emits the results of a function applied to sets of items emitted, in sequence, by two or more other Observables.OperatorZipIterable<T1,T2, R> Execute an action after onSuccess or onError has been delivered.Delays the subscription to the Single until the Observable fires an event or completes.SingleOnSubscribeMap<T,R> Applies a function of your choosing to every item emitted by anSingle
, and emits the results of this transformation as a newSingle
.SingleOnSubscribeUsing<T,Resource> Generates a resource, derives a Single from it and disposes that resource once the Single terminates.