Limit the execution of a code block on a specified time basis
| Modifiers | Name | Description |
|---|---|---|
static class |
Throttle.ThrottleObj |
| Type | Name and description |
|---|---|
static java.util.Map<java.lang.Integer, ThrottleObj> |
throttleMap |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static java.lang.Object |
after(long delay, groovy.lang.Closure closure)Allows at most one execution after the specified time delay returning
null before the first execution, and the cached result value the
following times |
|
static java.lang.Object |
after(Duration delay, groovy.lang.Closure closure)Allows at most one execution after the specified time delay returning
null before the first execution, and the cached result value the
following times |
|
static java.lang.Object |
after(java.lang.String delay, groovy.lang.Closure closure)Allows at most one execution after the specified time delay returning
null before the first execution, and the cached result value the
following times |
|
static java.lang.Object |
after(long delay, java.lang.Object initialValue, groovy.lang.Closure closure)Allows at most one execution after the specified time delay returning
initialValue before the first execution, and the cached result value the
following times |
|
static java.lang.Object |
after(Duration delay, java.lang.Object initialValue, groovy.lang.Closure closure)Allows at most one execution after the specified time delay returning
initialValue before the first execution, and the cached result value the
following times |
|
static java.lang.Object |
after(java.lang.String delay, java.lang.Object initialValue, groovy.lang.Closure closure)Allows at most one execution after the specified time delay returning
initialValue before the first execution, and the cached result value the
following times |
<V> |
static V |
cache(java.lang.Object key, Duration eviction, groovy.lang.Closure<V> action) |
<V> |
static V |
cache(java.lang.Object key, long eviction, groovy.lang.Closure<V> closure) |
|
static java.lang.Object |
every(long period, groovy.lang.Closure closure)Executes the specified code block and returns the resulting value. |
|
static java.lang.Object |
every(Duration period, groovy.lang.Closure closure)Executes the specified code block and returns the resulting value. |
|
static java.lang.Object |
every(java.lang.String period, groovy.lang.Closure closure)Executes the specified code block and returns the resulting value. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Allows at most one execution after the specified time delay returning
null before the first execution, and the cached result value the
following times
Allows at most one execution after the specified time delay returning
null before the first execution, and the cached result value the
following times
Allows at most one execution after the specified time delay returning
null before the first execution, and the cached result value the
following times
Allows at most one execution after the specified time delay returning
initialValue before the first execution, and the cached result value the
following times
Allows at most one execution after the specified time delay returning
initialValue before the first execution, and the cached result value the
following times
Allows at most one execution after the specified time delay returning
initialValue before the first execution, and the cached result value the
following times
Executes the specified code block and returns the resulting value. All following
invocations within the specified time period are skipped and the cached
result value is returned instead.
period
- The time period in milliseconds, in which the throttler will allow at most to invoke
the specified closureclosure
- The code block to execute Executes the specified code block and returns the resulting value. All following
invocations within the specified time period are skipped and the cached
result value is returned instead.
period
- The time duration, in which the throttler will allow at most to invoke
the specified closureclosure
- The code block to execute Executes the specified code block and returns the resulting value. All following
invocations within the specified time period are skipped and the cached
result value is returned instead.
period
- The duration string, in which the throttler will allow at most to invoke
the specified closureclosure
- The code block to execute