Class Client2RequestGate

java.lang.Object
org.voltdb.client.Client2RequestGate

public class Client2RequestGate extends Object
Provides a way to automatically handle Client2 request queue backpressure by blocking the calling thread.

Procedure calls are queued in the Client2 API for the duration of their execution. If the application is queueing calls faster than they can be processed, particularly when using callProcedureAsync, eventually the queue will reach its limit. The application can be made aware of an approaching limit by implementing a handler for "request backpressure" events; the application is expected to take whatever steps are needed in order to reduce the call rate. If it does not, then eventually the hard limit will be reached, and further calls will be rejected until the queue length falls below that limit.

Execution will not be blocked internally to the API when calling callProcedureAsync.

In some simple cases, it may nevertheless be appropriate to simply block execution of a thread that is about to issue callProcedureAsync This class, Client2RequestGate, facilitates that.

See Also: