public interface FlowControl
While in many cases it's desirable to automate the flow control algorithms, such automation may be sub-optimal (in a case of "auto-flush") or even completely objectionable (in a case of backlog-related delays if the caller is a part of an asynchronous communication flow by itself).
FlowControl represents a facet of a communication end point that allows clients to opt-out from an automatic flow control and manually govern the rate of the request flow.
Callers wishing to be exempt from automatic flow-control may declare themselves as
non-blocking
, code directly interacting
with flow-control methods is expected to check
if the calling thread has been marked as non-blocking and bypass automatic flow-control
for such callers.
Modifier and Type | Method and Description |
---|---|
boolean |
checkBacklog(com.oracle.coherence.common.base.Continuation<Void> continueNormal)
Check for an excessive backlog and if the underlying communication channel
is indeed clogged, call the specified continuation when the backlog is
back to normal or the service terminates.
|
long |
drainBacklog(long cMillis)
Check for an excessive backlog and allow blocking the calling thread for
up to the specified amount of time.
|
void |
flush()
Ensure that any buffered asynchronous operations are dispatched to the
underlying tier.
|
void flush()
Note: this is a non-blocking call.
long drainBacklog(long cMillis)
cMillis
- the maximum amount of time to wait (in milliseconds), or
zero for infinite waitboolean checkBacklog(com.oracle.coherence.common.base.Continuation<Void> continueNormal)
true
.
continueNormal
- (optional) Continuation
to be called when
the backlog has been reduced back to normal