@NotThreadSafe public class MWApiLimits extends Object
| Constructor and Description |
|---|
MWApiLimits(int limitResults,
int limitContinuations,
int limitEmptyContinuations)
Create a new tracker instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowContinuation()
Check whether one more continuation should be allowed,
without any change to the state of the tracker.
|
boolean |
allowResult()
Check whether one more API result should be allowed,
without any change to the state of the tracker.
|
void |
haveContinuation()
Inform the tracker that one more continuation has been performed,
and adjust the internal counters accordingly.
|
void |
haveResult()
Inform the tracker that one more API result has been retrieved,
and adjust the internal counters accordingly.
|
public MWApiLimits(int limitResults,
int limitContinuations,
int limitEmptyContinuations)
limitResults - maximum number of results to fetchlimitContinuations - maximum number of continuations to followlimitEmptyContinuations - maximum number of consecutive empty continuations to followpublic boolean allowResult()
public void haveResult()
public boolean allowContinuation()
public void haveContinuation()
Copyright © 2019. All rights reserved.