public final class CallIdSequenceWithBackpressure extends Object implements CallIdSequence
CallIdSequence that provides backpressure by taking
the number of in-flight operations into account when before creating a new call-id.
It is possible to temporarily create more concurrent invocations than the declared capacity due to:
| Constructor and Description |
|---|
CallIdSequenceWithBackpressure(int maxConcurrentInvocations,
long backoffTimeoutMs) |
| Modifier and Type | Method and Description |
|---|---|
void |
complete()
Not idempotent: must be called exactly once per invocation.
|
long |
forceNext()
Generates the next unique call ID.
|
long |
getLastCallId()
Returns the last issued call ID.
|
int |
getMaxConcurrentInvocations()
Returns the maximum concurrent invocations supported.
|
long |
next()
Generates the next unique call ID.
|
public CallIdSequenceWithBackpressure(int maxConcurrentInvocations,
long backoffTimeoutMs)
public long getLastCallId()
CallIdSequencegetLastCallId in interface CallIdSequencepublic int getMaxConcurrentInvocations()
CallIdSequencegetMaxConcurrentInvocations in interface CallIdSequencepublic long next()
throws TimeoutException
CallIdSequencenext in interface CallIdSequenceTimeoutException - if the outstanding invocation count hasn't dropped below the configured limit
within the configured timeoutpublic void complete()
CallIdSequencecomplete in interface CallIdSequencepublic long forceNext()
CallIdSequenceforceNext in interface CallIdSequenceCopyright © 2017 Hazelcast, Inc.. All Rights Reserved.