Package rx.internal.util
Interface BackpressureDrainManager.BackpressureQueueCallback
-
- All Known Implementing Classes:
OperatorOnBackpressureBuffer.BufferSubscriber
- Enclosing class:
- BackpressureDrainManager
public static interface BackpressureDrainManager.BackpressureQueueCallbackInterface representing the minimal callbacks required to operate the drain part of a backpressure system.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaccept(java.lang.Object value)Override this method to deliver an element to downstream.voidcomplete(java.lang.Throwable exception)Override this method to deliver a normal or exceptional terminal event.java.lang.Objectpeek()Override this method to peek for the next element, null meaning no next element available now.java.lang.Objectpoll()Override this method to poll (consume) the next element, null meaning no next element available now.
-
-
-
Method Detail
-
peek
java.lang.Object peek()
Override this method to peek for the next element, null meaning no next element available now.It will be called plain and while holding this object's monitor.
- Returns:
- the next element or null if no next element available
-
poll
java.lang.Object poll()
Override this method to poll (consume) the next element, null meaning no next element available now.- Returns:
- the next element or null if no next element available
-
accept
boolean accept(java.lang.Object value)
Override this method to deliver an element to downstream. The logic ensures that this happens only in the right conditions.- Parameters:
value- the value to deliver, not null- Returns:
- true indicates that one should terminate the emission loop unconditionally and not deliver any further elements or terminal events.
-
complete
void complete(java.lang.Throwable exception)
Override this method to deliver a normal or exceptional terminal event.- Parameters:
exception- if not null, contains the terminal exception
-
-