Create a Subscription using u
and add it to this Subscriber's list of Subscriptions if this list
is not marked as unsubscribed.
Create a Subscription using u
and add it to this Subscriber's list of Subscriptions if this list
is not marked as unsubscribed. If the list **is** marked as unsubscribed, it will call u
.
callback to run when unsubscribed
Add a Subscription to this Subscriber's list of Subscriptions if this list is not marked as unsubscribed.
Add a Subscription to this Subscriber's list of Subscriptions if this list is not marked as unsubscribed. If the list **is** marked as unsubscribed, it will unsubscribe the new Subscription as well.
the Subscription to add
EXPERIMENTAL Assert if there is exactly a single completion event.
EXPERIMENTAL Assert if there is exactly a single completion event.
(if this graduates from "Experimental" replace this parenthetical with the release number)
java.lang.AssertionError
if there were zero, or more than one, onCompleted events
EXPERIMENTAL Assert there is a single onError event with the exact exception.
EXPERIMENTAL Assert there is a single onError event with the exact exception.
the throwable to check
(if this graduates from "Experimental" replace this parenthetical with the release number)
java.lang.AssertionError
if there were zero, or more than one, onError events, or if the single onError
event did not carry an error that matches the specified throwable
EXPERIMENTAL Assert if there is exactly one error event which is a subclass of the given class.
EXPERIMENTAL Assert if there is exactly one error event which is a subclass of the given class.
the class to check the error against.
(if this graduates from "Experimental" replace this parenthetical with the release number)
java.lang.AssertionError
if there were zero, or more than one, onError events, or if the single onError
event did not carry an error of a subclass of the given class
Assert that this Subscriber has received no onError
notifications.
Assert that this Subscriber has received no onError
notifications.
java.lang.AssertionError
if this Subscriber has received one or more onError
notifications
EXPERIMENTAL Assert for no onError and onCompleted events.
EXPERIMENTAL Assert for no onError and onCompleted events.
(if this graduates from "Experimental" replace this parenthetical with the release number)
java.lang.AssertionError
if there was either an onError or onCompleted event
EXPERIMENTAL Assert if there are no onNext events received.
EXPERIMENTAL Assert if there are no onNext events received.
(if this graduates from "Experimental" replace this parenthetical with the release number)
java.lang.AssertionError
if there were any onNext events
EXPERIMENTAL Assert if there is no completion event.
EXPERIMENTAL Assert if there is no completion event.
(if this graduates from "Experimental" replace this parenthetical with the release number)
java.lang.AssertionError
if there were one or more than one onCompleted events
Assert that a single terminal event occurred, either onCompleted
or onError
.
Assert that a single terminal event occurred, either onCompleted
or onError
.
java.lang.AssertionError
if not exactly one terminal event notification was received
Assert that this Subscriber is unsubscribed.
Assert that this Subscriber is unsubscribed.
java.lang.AssertionError
if this Subscriber is not unsubscribed
EXPERIMENTAL Assert if there is only a single received onNext event and that it marks the emission of a specific item.
EXPERIMENTAL Assert if there is only a single received onNext event and that it marks the emission of a specific item.
the item to check
(if this graduates from "Experimental" replace this parenthetical with the release number)
java.lang.AssertionError
if the Observable does not emit only the single item specified by value
EXPERIMENTAL Assert if the given number of onNext events are received.
EXPERIMENTAL Assert if the given number of onNext events are received.
the expected number of onNext events
(if this graduates from "Experimental" replace this parenthetical with the release number)
java.lang.AssertionError
if there were more or fewer onNext events than specified by count
EXPERIMENTAL Assert if the received onNext events, in order, are the specified items.
EXPERIMENTAL Assert if the received onNext events, in order, are the specified items.
the items to check
(if this graduates from "Experimental" replace this parenthetical with the release number)
java.lang.AssertionError
if the items emitted do not exactly match those specified by values
Blocks until this Subscriber receives a notification that the Observable is complete
(either an onCompleted
or onError
notification), or until a timeout expires.
Blocks until this Subscriber receives a notification that the Observable is complete
(either an onCompleted
or onError
notification), or until a timeout expires.
the duration of the timeout
java.lang.RuntimeException
if the Subscriber is interrupted before the Observable is able to complete
Blocks until this Subscriber receives a notification that the Observable is complete
(either an onCompleted
or onError
notification).
Blocks until this Subscriber receives a notification that the Observable is complete
(either an onCompleted
or onError
notification).
java.lang.RuntimeException
if the Subscriber is interrupted before the Observable is able to complete
Blocks until this Subscriber receives a notification that the Observable is complete
(either an onCompleted
or onError
notification), or until a timeout expires; if the
Subscriber is interrupted before either of these events take place, this method unsubscribes the
Subscriber from the Observable).
Blocks until this Subscriber receives a notification that the Observable is complete
(either an onCompleted
or onError
notification), or until a timeout expires; if the
Subscriber is interrupted before either of these events take place, this method unsubscribes the
Subscriber from the Observable).
the duration of the timeout
Returns the last thread that was in use when an item or notification was received by this Subscriber.
Returns the last thread that was in use when an item or notification was received by this Subscriber.
the Thread
on which this Subscriber last received an item or notification from the
Observable it is subscribed to
Get the Throwable
s this Subscriber was notified of via onError
Get the Throwable
s this Subscriber was notified of via onError
a sequence of the Throwable
s that were passed to the Subscriber.onError method
Get the sequence of items observed by this Subscriber.
Get the sequence of items observed by this Subscriber.
a sequence of items observed by this Subscriber, in the order in which they were observed
Indicates whether this Subscriber has unsubscribed from its list of Subscriptions.
Indicates whether this Subscriber has unsubscribed from its list of Subscriptions.
true
if this Subscriber has unsubscribed from its Subscriptions, false
otherwise
Notifies the Observer that the rx.lang.scala.Observable has finished sending push-based notifications.
Notifies the Observer that the rx.lang.scala.Observable has finished sending push-based notifications.
The rx.lang.scala.Observable will not call this method if it calls onError
.
Notifies the Observer that the rx.lang.scala.Observable has experienced an error condition.
Notifies the Observer that the rx.lang.scala.Observable has experienced an error condition.
If the rx.lang.scala.Observable calls this method, it will not thereafter call onNext
or onCompleted
.
Provides the Observer with new data.
Provides the Observer with new data.
The rx.lang.scala.Observable calls this closure 0 or more times.
The rx.lang.scala.Observable will not call this method again after it calls either onCompleted
or onError
.
This method is invoked when the Subscriber and Observable have been connected but the Observable has not yet begun to emit items or send notifications to the Subscriber.
This method is invoked when the Subscriber and Observable have been connected but the Observable has not yet begun to emit items or send notifications to the Subscriber. Override this method to add any useful initialization to your subscription, for instance to initiate backpressure.
Observable.just(1, 2, 3).subscribe(new Subscriber[Int]() { override def onStart(): Unit = request(1) override def onNext(v: Int): Unit = { println(v) request(1) } override def onError(e: Throwable): Unit = e.printStackTrace() override def onCompleted(): Unit = {} })
Request a certain maximum number of emitted items from the Observable this Subscriber is subscribed to.
Request a certain maximum number of emitted items from the Observable this Subscriber is subscribed to.
This is a way of requesting backpressure. To disable backpressure, pass Long.MaxValue
to this method.
the maximum number of items you want the Observable to emit to the Subscriber at this time, or
Long.MaxValue
if you want the Observable to emit items at its own pace
Allow calling the protected request from unit tests.
Allow calling the protected request from unit tests.
the maximum number of items you want the Observable to emit to the Subscriber at this time, or
Long.MaxValue
if you want the Observable to emit items at its own pace
Unsubscribe all Subscriptions added to this Subscriber's .
Unsubscribe all Subscriptions added to this Subscriber's .
A TestSubscriber is a variety of Subscriber that you can use for unit testing, to perform assertions, inspect received events, or wrap a mocked Subscriber.