- 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
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA back pressure strategy that uses callbacks to notify when the client is ready or cancelled.static enumThe state of the client after a call to waitForListener. -
Method Summary
Modifier and TypeMethodDescriptionvoidregister(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.
-