public interface TimeoutController
Note: This interface is meant for internal use only.
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancelTimeout()
Cancels the current timeout scheduled.
|
boolean |
extendTimeout(long adjustmentMillis)
Extends the current timeout by the specified
adjustmentMillis. |
boolean |
isTimedOut()
Returns whether the timeout has been triggered or not.
|
boolean |
resetTimeout(long newTimeoutMillis)
Sets the amount of time that is after the specified
newTimeoutMillis from now. |
boolean |
scheduleTimeout(long timeoutMillis)
Schedules a new timeout with the specified
timeoutMillis. |
Long |
startTimeNanos()
Returns the start time of the initial timeout in nanoseconds
or
null if no timeout was scheduled previously. |
boolean |
timeoutNow()
Trigger the current timeout immediately.
|
boolean scheduleTimeout(long timeoutMillis)
timeoutMillis.
If a timeout is scheduled already, this method will not start a new timeout.timeoutMillis - a positive time amount value in milliseconds.true if the timeout is scheduled.
false if the timeout has been scheduled, triggered already
or a timeout cannot be scheduled, e.g. request or response has been handled already.boolean extendTimeout(long adjustmentMillis)
adjustmentMillis.
Note that a negative adjustmentMillis reduces the current timeout.adjustmentMillis - the adjustment of time amount value in milliseconds.true if the current timeout is extended by the specified adjustmentMillis.
false if no timeout was scheduled previously, the timeout has been triggered already
or a timeout cannot be scheduled, e.g. request or response has been handled already.boolean resetTimeout(long newTimeoutMillis)
newTimeoutMillis from now.newTimeoutMillis - the new timeout value in milliseconds. 0 if disabled.true if the current timeout is reset by the specified newTimeoutMillis.
false if the timeout has been triggered already
or a timeout cannot be scheduled, e.g. request or response has been handled already.boolean timeoutNow()
true if the current timeout is triggered successfully.
false if the timeout has been triggered already
or a timeout cannot be scheduled, e.g. request or response has been handled already.boolean cancelTimeout()
scheduleTimeout(long) if the current timeout is cancelled successfully.true if the current timeout is cancelled.
false if the timeout has been triggered already or no timeout was scheduled previously.boolean isTimedOut()
true if the timeout has been triggered already.
false if the timeout is scheduled now or no timeout was scheduled previously.Long startTimeNanos()
null if no timeout was scheduled previously.Copyright © 2020 LeanCloud. All rights reserved.