Top Description Inners Methods
rx

public Interface Emitter<T>

extends Observer<T>
Known Direct Implementers
rx.internal.operators.OnSubscribeCreate.BaseEmitter
Type Parameters
<T>
the value type to emit
Imports
rx.functions.Cancellable

Abstraction over a RxJava Subscriber that allows associating a resource with it and exposes the current number of downstream requested amount.

The onNext, onError and onCompleted methods should be called in a sequential manner, just like the Observer's methods. The other methods are thread-safe.

Since
1.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Emitter.BackpressureMode

Options to handle backpressure in the emitter.

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

the current outstanding request amount
requested
()

The current outstanding request amount.

public void
setCancellation(Cancellable
the cancellable resource, null is allowed
c
)

Sets a Cancellable on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.

public void
setSubscription(Subscription
the subscription, null is allowed
s
)

Sets a Subscription on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.

Inherited from rx.Observer:
onCompletedonErroronNext

Method Detail

requestedback to summary
public long requested()

The current outstanding request amount.

This method it thread-safe.

Returns:long

the current outstanding request amount

setCancellationback to summary
public void setCancellation(Cancellable c)

Sets a Cancellable on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.

Parameters
c:Cancellable

the cancellable resource, null is allowed

setSubscriptionback to summary
public void setSubscription(Subscription s)

Sets a Subscription on this emitter; any previous Subscription or Cancellation will be unsubscribed/cancelled.

Parameters
s:Subscription

the subscription, null is allowed

rx back to summary

public final Enum Emitter.BackpressureMode

extends Enum<Emitter.BackpressureMode>
Class Inheritance

Options to handle backpressure in the emitter.

Field Summary

Modifier and TypeField and Description
public static final Emitter.BackpressureMode
BUFFER

Buffers (unbounded) all onNext calls until the downstream can consume them.

public static final Emitter.BackpressureMode
DROP

Drops the incoming onNext value if the downstream can't keep up.

public static final Emitter.BackpressureMode
ERROR

Signals a rx.exceptions.MissingBackpressureException if the downstream can't keep up.

public static final Emitter.BackpressureMode
LATEST

Keeps the latest onNext value and overwrites it with newer ones until the downstream can consume it.

public static final Emitter.BackpressureMode
NONE

No backpressure is applied as the onNext calls pass through the Emitter; note that this may cause rx.exceptions.MissingBackpressureException or IllegalStateException somewhere downstream.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Emitter.BackpressureMode
public static Emitter.BackpressureMode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BUFFERback to summary
public static final Emitter.BackpressureMode BUFFER

Buffers (unbounded) all onNext calls until the downstream can consume them.

DROPback to summary
public static final Emitter.BackpressureMode DROP

Drops the incoming onNext value if the downstream can't keep up.

ERRORback to summary
public static final Emitter.BackpressureMode ERROR

Signals a rx.exceptions.MissingBackpressureException if the downstream can't keep up.

LATESTback to summary
public static final Emitter.BackpressureMode LATEST

Keeps the latest onNext value and overwrites it with newer ones until the downstream can consume it.

NONEback to summary
public static final Emitter.BackpressureMode NONE

No backpressure is applied as the onNext calls pass through the Emitter; note that this may cause rx.exceptions.MissingBackpressureException or IllegalStateException somewhere downstream.

Constructor Detail

BackpressureModeback to summary
private BackpressureMode()

Method Detail

valueOfback to summary
public static Emitter.BackpressureMode valueOf(String name)
valuesback to summary
public static Emitter.BackpressureMode[] values()