private static enum AbstractListenerReadPublisher.State extends java.lang.Enum<AbstractListenerReadPublisher.State>
Publisher
to be in. The following figure
indicate the four different states that exist, and the relationships between them.
UNSUBSCRIBED | v NO_DEMAND -------------------> DEMAND | ^ ^ | | | | | | --------- READING <----- | | | | | v | ------------> COMPLETED <---------Refer to the individual states for more information.
Enum Constant and Description |
---|
COMPLETED
The terminal completed state.
|
DEMAND
State that gets entered when there is demand.
|
NO_DEMAND
State that gets entered when there is no demand.
|
READING |
UNSUBSCRIBED
The initial unsubscribed state.
|
Modifier and Type | Method and Description |
---|---|
(package private) <T> void |
cancel(AbstractListenerReadPublisher<T> publisher) |
(package private) <T> void |
onAllDataRead(AbstractListenerReadPublisher<T> publisher) |
(package private) <T> void |
onDataAvailable(AbstractListenerReadPublisher<T> publisher) |
(package private) <T> void |
onError(AbstractListenerReadPublisher<T> publisher,
java.lang.Throwable t) |
(package private) <T> void |
request(AbstractListenerReadPublisher<T> publisher,
long n) |
(package private) <T> void |
subscribe(AbstractListenerReadPublisher<T> publisher,
<any> subscriber) |
static AbstractListenerReadPublisher.State |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static AbstractListenerReadPublisher.State[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AbstractListenerReadPublisher.State UNSUBSCRIBED
#subscribe(AbstractListenerReadPublisher, Subscriber)
by
changing state to NO_DEMAND
.public static final AbstractListenerReadPublisher.State NO_DEMAND
request(AbstractListenerReadPublisher, long)
by increasing the demand,
changing state to DEMAND
and will check whether there
is data available for reading.public static final AbstractListenerReadPublisher.State DEMAND
onDataAvailable(AbstractListenerReadPublisher)
by
reading the available data. The state will be changed to
NO_DEMAND
if there is no demand.public static final AbstractListenerReadPublisher.State READING
public static final AbstractListenerReadPublisher.State COMPLETED
public static AbstractListenerReadPublisher.State[] values()
for (AbstractListenerReadPublisher.State c : AbstractListenerReadPublisher.State.values()) System.out.println(c);
public static AbstractListenerReadPublisher.State valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null<T> void subscribe(AbstractListenerReadPublisher<T> publisher, <any> subscriber)
<T> void request(AbstractListenerReadPublisher<T> publisher, long n)
<T> void cancel(AbstractListenerReadPublisher<T> publisher)
<T> void onDataAvailable(AbstractListenerReadPublisher<T> publisher)
<T> void onAllDataRead(AbstractListenerReadPublisher<T> publisher)
<T> void onError(AbstractListenerReadPublisher<T> publisher, java.lang.Throwable t)