public interface GateKeeper
Modifier and Type | Method and Description |
---|---|
boolean |
awaitDrained(long timeout,
java.util.concurrent.TimeUnit unit)
Waits for the server to finish outstanding requests, giving up if the timeout is reached.
|
void |
close()
Closes the gate to disallow incoming requests to be processed.
|
int |
getNumOutstandingRequests()
Returns the number of outstanding requests.
|
boolean |
isOpen()
Returns if the gate is open or not.
|
boolean |
letIn()
Lets a new request in to process it in the server if the gate is open.
|
void |
letOut()
Lets a processed request out.
|
void |
open()
Opens the gate to allow incoming requests to be processed.
|
void open()
void close()
boolean isOpen()
int getNumOutstandingRequests()
boolean awaitDrained(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
timeout
- the maximum time to waitunit
- the time unit of the timeout argumentjava.lang.InterruptedException
- if interrupted while waitingboolean letIn()
void letOut()