Type-class instances for Observable.
Given a sequence of elements, builds an observable from it.
Transforms a non-strict Coeval value
into an Observable
that emits a single element.
Creates a combined observable from 2 source observables.
Creates a combined observable from 2 source observables.
This operator behaves in a similar way to zip2,
but while zip
emits items only when all of the zipped source
observables have emitted a previously unzipped item, combine
emits an item whenever any of the source Observables emits an
item (so long as each of the source Observables has emitted at
least one item).
Creates a combined observable from 3 source observables.
Creates a combined observable from 3 source observables.
This operator behaves in a similar way to zip3,
but while zip
emits items only when all of the zipped source
observables have emitted a previously unzipped item, combine
emits an item whenever any of the source Observables emits an
item (so long as each of the source Observables has emitted at
least one item).
Creates a combined observable from 4 source observables.
Creates a combined observable from 4 source observables.
This operator behaves in a similar way to zip4,
but while zip
emits items only when all of the zipped source
observables have emitted a previously unzipped item, combine
emits an item whenever any of the source Observables emits an
item (so long as each of the source Observables has emitted at
least one item).
Creates a combined observable from 5 source observables.
Creates a combined observable from 5 source observables.
This operator behaves in a similar way to zip5,
but while zip
emits items only when all of the zipped source
observables have emitted a previously unzipped item, combine
emits an item whenever any of the source Observables emits an
item (so long as each of the source Observables has emitted at
least one item).
Creates a combined observable from 6 source observables.
Creates a combined observable from 6 source observables.
This operator behaves in a similar way to zip6,
but while zip
emits items only when all of the zipped source
observables have emitted a previously unzipped item, combine
emits an item whenever any of the source Observables emits an
item (so long as each of the source Observables has emitted at
least one item).
Given an observable sequence, it combines them together (using combineLatest) returning a new observable that generates sequences.
Creates a combined observable from 2 source observables.
Creates a combined observable from 2 source observables.
This operator behaves in a similar way to zipMap2,
but while zip
emits items only when all of the zipped source
observables have emitted a previously unzipped item, combine
emits an item whenever any of the source Observables emits an
item (so long as each of the source Observables has emitted at
least one item).
Creates a combined observable from 3 source observables.
Creates a combined observable from 3 source observables.
This operator behaves in a similar way to zipMap3,
but while zip
emits items only when all of the zipped source
observables have emitted a previously unzipped item, combine
emits an item whenever any of the source Observables emits an
item (so long as each of the source Observables has emitted at
least one item).
Creates a combined observable from 4 source observables.
Creates a combined observable from 4 source observables.
This operator behaves in a similar way to zipMap4,
but while zip
emits items only when all of the zipped source
observables have emitted a previously unzipped item, combine
emits an item whenever any of the source Observables emits an
item (so long as each of the source Observables has emitted at
least one item).
Creates a combined observable from 5 source observables.
Creates a combined observable from 5 source observables.
This operator behaves in a similar way to zipMap5,
but while zip
emits items only when all of the zipped source
observables have emitted a previously unzipped item, combine
emits an item whenever any of the source Observables emits an
item (so long as each of the source Observables has emitted at
least one item).
Creates a combined observable from 6 source observables.
Creates a combined observable from 6 source observables.
This operator behaves in a similar way to zipMap6,
but while zip
emits items only when all of the zipped source
observables have emitted a previously unzipped item, combine
emits an item whenever any of the source Observables emits an
item (so long as each of the source Observables has emitted at
least one item).
Concatenates the given list of observables into a single observable.
Concatenates the given list of observables into a single observable.
Concatenates the given list of observables into a single observable. Delays errors until the end.
Builds a new observable from a strict head
and a lazily
evaluated head.
Creates an observable from a function that receives a concurrent and safe Subscriber.Sync.
Creates an observable from a function that receives a concurrent and safe Subscriber.Sync.
This builder represents the safe way of building observables from data-sources that cannot be back-pressured.
Returns a new observable that creates a sequence from the given factory on each subscription.
Alias for eval.
Creates an observable that doesn't emit anything, but immediately
calls onComplete
instead.
Given a non-strict value, converts it into an Observable that upon subscription, evaluates the expression and emits a single element.
Lifts a non-strict value into an observable that emits a single element, but upon subscription delay its evaluation by the specified timespan
Given a non-strict value, converts it into an Observable that emits a single element and that memoizes the value for subsequent invocations.
Given a list of source Observables, emits all of the items from the first of these Observables to emit an item or to complete, and cancel the rest.
Concatenates the given list of observables into a single observable.
Concatenates the given list of observables into a single observable.
Concatenates the given list of observables into a single observable. Delays errors until the end.
Forks a logical thread on executing the subscription.
Given an initial state and a generator function that produces the next state and the next element in the sequence, creates an observable that keeps generating elements produced by our generator function.
Converts a java.io.Reader
into an observable
that will emit Array[Char]
elements.
Converts a java.io.Reader
into an observable
that will emit Array[Char]
elements.
WARNING: reading from a reader is a destructive process. Therefore only a single subscriber is supported, the result being a single-subscriber observable. If multiple subscribers are attempted, all subscribers, except for the first one, will be terminated with a MultipleSubscribersException.
Therefore, if you need a factory of data sources, from a cold source such
as a java.io.File
from which you can open how many file handles you want,
you can use Observable.defer to build such a factory. Or you can share
the resulting observable by converting it into a
ConnectableObservable
by means of multicast.
is the Reader
to convert into an observable
is the maximum length of the emitted arrays of chars. It's also used when reading from the reader.
Converts a java.io.Reader
into an observable
that will emit Array[Char]
elements.
Converts a java.io.Reader
into an observable
that will emit Array[Char]
elements.
WARNING: reading from a reader is a destructive process. Therefore only a single subscriber is supported, the result being a single-subscriber observable. If multiple subscribers are attempted, all subscribers, except for the first one, will be terminated with a MultipleSubscribersException.
Therefore, if you need a factory of data sources, from a cold source such
as a java.io.File
from which you can open how many file handles you want,
you can use Observable.defer to build such a factory. Or you can share
the resulting observable by converting it into a
ConnectableObservable
by means of multicast.
is the Reader
to convert into an observable
Converts a Scala Future
provided into an Observable.
Converts a Scala Future
provided into an Observable.
If the created instance is a
CancelableFuture,
then it will be used for the returned
Cancelable on subscribe
.
Converts a java.io.InputStream
into an
observable that will emit Array[Byte]
elements.
Converts a java.io.InputStream
into an
observable that will emit Array[Byte]
elements.
WARNING: reading from the input stream is a destructive process. Therefore only a single subscriber is supported, the result being a single-subscriber observable. If multiple subscribers are attempted, all subscribers, except for the first one, will be terminated with a MultipleSubscribersException.
Therefore, if you need a factory of data sources, from a cold source such
as a java.io.File
from which you can open how many file handles you want,
you can use Observable.defer to build such a factory. Or you can share
the resulting observable by converting it into a
ConnectableObservable
by means of multicast.
is the InputStream
to convert into an observable
is the maximum length of the emitted arrays of bytes. It's also used when reading from the input stream.
Converts a java.io.InputStream
into an
observable that will emit Array[Byte]
elements.
Converts a java.io.InputStream
into an
observable that will emit Array[Byte]
elements.
WARNING: reading from the input stream is a destructive process. Therefore only a single subscriber is supported, the result being a single-subscriber observable. If multiple subscribers are attempted, all subscribers, except for the first one, will be terminated with a MultipleSubscribersException.
Therefore, if you need a factory of data sources, from a cold source such
as a java.io.File
from which you can open how many file handles you want,
you can use Observable.defer to build such a factory. Or you can share
the resulting observable by converting it into a
ConnectableObservable
by means of multicast.
is the InputStream
to convert into an observable
Converts any Iterable
into an Observable.
Converts any Iterator
into an observable.
Converts any Iterator
into an observable.
WARNING: reading from an Iterator
is a destructive process.
Therefore only a single subscriber is supported, the result being
a single-subscriber observable. If multiple subscribers are attempted,
all subscribers, except for the first one, will be terminated with a
MultipleSubscribersException.
Therefore, if you need a factory of data sources, from a cold source from which you can open how many iterators you want, you can use Observable.defer to build such a factory. Or you can share the resulting observable by converting it into a ConnectableObservable by means of multicast.
This variant of fromIterator
takes an onFinish
callback that
will be called when the streaming is finished, either with
onComplete
, onError
, when the downstream signals a Stop
or
when the subscription gets canceled.
This onFinish
callback is guaranteed to be called only once.
Useful for controlling resource deallocation (e.g. closing file handles).
to transform into an observable
a callback that will be called for resource deallocation whenever the iterator is complete, or when the stream is canceled
Converts any Iterator
into an observable.
Converts any Iterator
into an observable.
WARNING: reading from an Iterator
is a destructive process.
Therefore only a single subscriber is supported, the result being
a single-subscriber observable. If multiple subscribers are attempted,
all subscribers, except for the first one, will be terminated with a
MultipleSubscribersException.
Therefore, if you need a factory of data sources, from a cold source from which you can open how many iterators you want, you can use Observable.defer to build such a factory. Or you can share the resulting observable by converting it into a ConnectableObservable by means of multicast.
to transform into an observable
Converts a java.io.BufferedReader
into an
observable that will emit String
text lines from the input.
Converts a java.io.BufferedReader
into an
observable that will emit String
text lines from the input.
Note that according to the specification of BufferedReader
, a
line is considered to be terminated by any one of a line
feed (\n
), a carriage return (\r
), or a carriage return
followed immediately by a linefeed.
WARNING: reading from a reader is a destructive process. Therefore only a single subscriber is supported, the result being a single-subscriber observable. If multiple subscribers are attempted, all subscribers, except for the first one, will be terminated with a MultipleSubscribersException.
Therefore, if you need a factory of data sources, from a cold source such
as a java.io.File
from which you can open how many file handles you want,
you can use Observable.defer to build such a factory. Or you can share
the resulting observable by converting it into a
ConnectableObservable
by means of multicast.
is the Reader
to convert into an observable
Given a org.reactivestreams.Publisher
, converts it into a
Monix / Rx Observable.
Given a org.reactivestreams.Publisher
, converts it into a
Monix / Rx Observable.
See the Reactive Streams protocol that Monix implements.
Observable.toReactive for converting an Observable
to
a reactive publisher.
Given an initial state and a generator function that produces the next state and the next element in the sequence, creates an observable that keeps generating elements produced by our generator function.
Converts any Task into an Observable.
Creates a new observable from this observable and another given observable by interleaving their items into a strictly alternating sequence.
Creates a new observable from this observable and another given observable by interleaving their items into a strictly alternating sequence.
So the first item emitted by the new observable will be the item emitted by
self
, the second item will be emitted by the other observable, and so forth;
when either self
or other
calls onCompletes
, the items will then be
directly coming from the observable that has not completed; when onError
is
called by either self
or other
, the new observable will call onError
and halt.
See merge for a more relaxed alternative that doesn't emit items in strict alternating sequence.
Creates an Observable that emits auto-incremented natural numbers (longs) spaced by a given time interval.
Creates an Observable that emits auto-incremented natural numbers
(longs) spaced by a given time interval. Starts from 0 with no
delay, after which it emits incremented numbers spaced by the
period
of time. The given period
of time acts as a fixed
delay between successive events.
the delay between 2 successive events
Creates an Observable that emits auto-incremented natural numbers
(longs) at a fixed rate, as given by the specified period
.
Creates an Observable that emits auto-incremented natural numbers
(longs) at a fixed rate, as given by the specified period
. The
time it takes to process an onNext
event gets subtracted from
the specified period
and thus the created observable tries to
emit events spaced by the given time interval, regardless of how
long the processing of onNext
takes.
This version of the intervalAtFixedRate
allows specifying an
initialDelay
before events start being emitted.
is the initial delay before emitting the first event
the period between 2 successive onNext
events
Creates an Observable that emits auto-incremented natural numbers
(longs) at a fixed rate, as given by the specified period
.
Creates an Observable that emits auto-incremented natural numbers
(longs) at a fixed rate, as given by the specified period
. The
time it takes to process an onNext
event gets subtracted from
the specified period
and thus the created observable tries to
emit events spaced by the given time interval, regardless of how
long the processing of onNext
takes.
the period between 2 successive onNext
events
Creates an Observable that emits auto-incremented natural numbers (longs) spaced by a given time interval.
Creates an Observable that emits auto-incremented natural numbers
(longs) spaced by a given time interval. Starts from 0 with no
delay, after which it emits incremented numbers spaced by the
period
of time. The given period
of time acts as a fixed
delay between successive events.
is the delay to wait before emitting the first event
the time to wait between 2 successive events
Creates an Observable that emits auto-incremented natural numbers (longs) spaced by a given time interval.
Creates an Observable that emits auto-incremented natural numbers
(longs) spaced by a given time interval. Starts from 0 with no
delay, after which it emits incremented numbers spaced by the
period
of time. The given period
of time acts as a fixed
delay between successive events.
the delay between 2 successive events
Merges the given list of observables into a single observable.
Merges the given list of observables into a single observable.
Merges the given list of observables into a single observable. Delays errors until the end.
Creates an input channel and an output observable pair for building a multicast data-source.
Creates an input channel and an output observable pair for building a multicast data-source.
Useful for building multicast observables from data-sources that cannot be back-pressured.
Prefer Observable.create when possible.
is the multicast strategy to use (e.g. publish, behavior, reply, async)
is the overflow strategy for the buffer that gets placed in front (since this will be a hot data-source that cannot be back-pressured)
Creates an input channel and an output observable pair for building a multicast data-source.
Creates an input channel and an output observable pair for building a multicast data-source.
Useful for building multicast observables from data-sources that cannot be back-pressured.
Prefer Observable.create when possible.
is the multicast strategy to use (e.g. publish, behavior, reply, async)
Creates an Observable that doesn't emit anything and that never completes.
Returns an Observable
that on execution emits the given strict value.
Lifts an element into the Observable
context.
Lifts an element into the Observable
context.
Alias for now.
Creates an Observable that emits an error.
Creates an Observable that emits items in the given range.
Creates an Observable that emits items in the given range.
the range start
the range end
increment step, either positive or negative
Creates an Observable that continuously emits the given item repeatedly.
Repeats the execution of the given task
, emitting
the results indefinitely.
Alias for defer.
Given a sequence of observables, builds an observable that emits the elements of the most recently emitted observable.
Create an Observable that repeatedly emits the given item
, until
the underlying Observer cancels.
Wraps this Observable into a org.reactivestreams.Publisher
.
Wraps this Observable into a org.reactivestreams.Publisher
.
See the Reactive Streams
protocol that Monix implements.
Implicit type-class instances for Observable.
Given a subscribe function, lifts it into an Observable.
Given a subscribe function, lifts it into an Observable.
This function is unsafe to use because users have to know and apply the Monix communication contract, related to thread-safety, communicating demand (back-pressure) and error handling.
Only use if you know what you're doing. Otherwise prefer create.
Creates a new observable from two observable sequences by combining their items in pairs in a strict sequence.
Creates a new observable from two observable sequences by combining their items in pairs in a strict sequence.
So the first item emitted by the new observable will be the result of the function applied to the first items emitted by each of the source observables; the second item emitted by the new observable will be the result of the function applied to the second items emitted by each of those observables; and so forth.
See combineLatestMap2 for a more relaxed alternative that doesn't combine items in strict sequence.
Creates a new observable from three observable sequences by combining their items in pairs in a strict sequence.
Creates a new observable from three observable sequences by combining their items in pairs in a strict sequence.
So the first item emitted by the new observable will be the result of the function applied to the first items emitted by each of the source observables; the second item emitted by the new observable will be the result of the function applied to the second items emitted by each of those observables; and so forth.
See combineLatestMap3 for a more relaxed alternative that doesn't combine items in strict sequence.
Creates a new observable from four observable sequences by combining their items in pairs in a strict sequence.
Creates a new observable from four observable sequences by combining their items in pairs in a strict sequence.
So the first item emitted by the new observable will be the result of the function applied to the first items emitted by each of the source observables; the second item emitted by the new observable will be the result of the function applied to the second items emitted by each of those observables; and so forth.
See combineLatestMap4 for a more relaxed alternative that doesn't combine items in strict sequence.
Creates a new observable from five observable sequences by combining their items in pairs in a strict sequence.
Creates a new observable from five observable sequences by combining their items in pairs in a strict sequence.
So the first item emitted by the new observable will be the result of the function applied to the first items emitted by each of the source observables; the second item emitted by the new observable will be the result of the function applied to the second items emitted by each of those observables; and so forth.
See combineLatestMap5 for a more relaxed alternative that doesn't combine items in strict sequence.
Creates a new observable from five observable sequences by combining their items in pairs in a strict sequence.
Creates a new observable from five observable sequences by combining their items in pairs in a strict sequence.
So the first item emitted by the new observable will be the result of the function applied to the first items emitted by each of the source observables; the second item emitted by the new observable will be the result of the function applied to the second items emitted by each of those observables; and so forth.
See combineLatestMap5 for a more relaxed alternative that doesn't combine items in strict sequence.
Given an observable sequence, it zips them together returning a new observable that generates sequences.
Creates a new observable from two observable sequences by combining their items in pairs in a strict sequence.
Creates a new observable from two observable sequences by combining their items in pairs in a strict sequence.
So the first item emitted by the new observable will be the result of the function applied to the first items emitted by each of the source observables; the second item emitted by the new observable will be the result of the function applied to the second items emitted by each of those observables; and so forth.
See combineLatestMap2 for a more relaxed alternative that doesn't combine items in strict sequence.
is the mapping function applied over the generated pairs
Creates a new observable from three observable sequences by combining their items in pairs in a strict sequence.
Creates a new observable from three observable sequences by combining their items in pairs in a strict sequence.
So the first item emitted by the new observable will be the result of the function applied to the first items emitted by each of the source observables; the second item emitted by the new observable will be the result of the function applied to the second items emitted by each of those observables; and so forth.
See combineLatestMap3 for a more relaxed alternative that doesn't combine items in strict sequence.
is the mapping function applied over the generated pairs
Creates a new observable from four observable sequences by combining their items in pairs in a strict sequence.
Creates a new observable from four observable sequences by combining their items in pairs in a strict sequence.
So the first item emitted by the new observable will be the result of the function applied to the first items emitted by each of the source observables; the second item emitted by the new observable will be the result of the function applied to the second items emitted by each of those observables; and so forth.
See combineLatestMap4 for a more relaxed alternative that doesn't combine items in strict sequence.
is the mapping function applied over the generated pairs
Creates a new observable from five observable sequences by combining their items in pairs in a strict sequence.
Creates a new observable from five observable sequences by combining their items in pairs in a strict sequence.
So the first item emitted by the new observable will be the result of the function applied to the first items emitted by each of the source observables; the second item emitted by the new observable will be the result of the function applied to the second items emitted by each of those observables; and so forth.
See combineLatestMap5 for a more relaxed alternative that doesn't combine items in strict sequence.
is the mapping function applied over the generated pairs
Creates a new observable from five observable sequences by combining their items in pairs in a strict sequence.
Creates a new observable from five observable sequences by combining their items in pairs in a strict sequence.
So the first item emitted by the new observable will be the result of the function applied to the first items emitted by each of the source observables; the second item emitted by the new observable will be the result of the function applied to the second items emitted by each of those observables; and so forth.
See combineLatestMap5 for a more relaxed alternative that doesn't combine items in strict sequence.
is the mapping function applied over the generated pairs
(Since version 2.0-RC12) Renamed to Observable.combineLatestMap2
(Since version 2.0-RC12) Renamed to Observable.combineLatestMap3
(Since version 2.0-RC12) Renamed to Observable.combineLatestMap4
(Since version 2.0-RC12) Renamed to Observable.combineLatestMap5
(Since version 2.0-RC12) Renamed to Observable.combineLatestMap6
Alias for eval.
Alias for eval. Deprecated.
(Since version 2.0-RC12) Renamed, please use Observable.eval
(Since version 2.0-RC12) Renamed to Observable.zipMap2
(Since version 2.0-RC12) Renamed to Observable.zipMap3
(Since version 2.0-RC12) Renamed to Observable.zipMap4
(Since version 2.0-RC12) Renamed to Observable.zipMap5
(Since version 2.0-RC12) Renamed to Observable.zipMap6
Observable builders.