public interface PausableMulti
Interface for controlling a pausable Multi stream.
This interface defines the contract for pausing and resuming demand propagation in a reactive stream.
Implementations of this interface are typically bound to a DemandPauser to provide external control.
This is an internal interface used by the demand pausing operator.
Users should interact with DemandPauser instead.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the current number of buffered items.booleanClears the buffer if currently paused.booleanisPaused()Checks if demand propagation is currently paused.voidpause()Pauses demand propagation to the upstream.voidresume()Resumes demand propagation to the upstream.
-
Method Details
-
pause
void pause()Pauses demand propagation to the upstream. -
resume
void resume()Resumes demand propagation to the upstream. -
isPaused
boolean isPaused()Checks if demand propagation is currently paused. -
bufferSize
int bufferSize()Returns the current number of buffered items. Only applicable when usingBackPressureStrategy.BUFFER.- Returns:
- the number of buffered items, or 0 if no buffer is used
-
clearBuffer
boolean clearBuffer()Clears the buffer if currently paused. Only applicable when usingBackPressureStrategy.BUFFER.- Returns:
trueif the buffer was cleared,falseif not paused or no buffer exists
-