- All Known Implementing Classes:
BackpressureStrategy.CallbackBackpressureStrategy
public interface BackpressureStrategy
Helper interface to dynamically handle backpressure when implementing FlightProducers. This must
only be used in FlightProducer implementations that are non-blocking.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
A back pressure strategy that uses callbacks to notify when the client is ready or cancelled.static enum
The state of the client after a call to waitForListener. -
Method Summary
Modifier and TypeMethodDescriptionvoid
register
(FlightProducer.ServerStreamListener listener) Set up operations to work against the given listener.waitForListener
(long timeout) Waits for the listener to be ready or cancelled up to the given timeout.
-
Method Details
-
register
Set up operations to work against the given listener.This must be called exactly once and before any calls to
waitForListener(long)
andOutboundStreamListener.start(VectorSchemaRoot)
- Parameters:
listener
- The listener this strategy applies to.
-
waitForListener
Waits for the listener to be ready or cancelled up to the given timeout.- Parameters:
timeout
- The timeout in milliseconds. Infinite if timeout is <= 0.- Returns:
- The result of the wait.
-