Enum RateSpec.Verb
- java.lang.Object
-
- java.lang.Enum<RateSpec.Verb>
-
- io.engineblock.activityapi.ratelimits.RateSpec.Verb
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<RateSpec.Verb>,java.lang.constant.Constable
- Enclosing class:
- RateSpec
public static enum RateSpec.Verb extends java.lang.Enum<RateSpec.Verb>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description configureSpecify that a rate limiter should only be configured without affecting its running state.restartThe restart action on a rate limiter causes it to be re-initialized as if it were just being started for the first time.startThe default SetAction is start.
-
Method Summary
Modifier and Type Method Description static RateSpec.VerbvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static RateSpec.Verb[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
configure
public static final RateSpec.Verb configure
Specify that a rate limiter should only be configured without affecting its running state. If the rate limiter is already running, then the configuration should take effect immediately. A rate limiter will be created automatically if needed. Configurations that do not effectively change the rate limiter are ignored.
-
start
public static final RateSpec.Verb start
The default SetAction is start. This means that the rate limiter should be started at the time this rate spec is applied. The start time of a rate limiter is significant in that it determines both the calculated average rate as well as the accumulated wait time from slow callers. In order to start, a rate limiter will be configured automatically, if the provided rate spec would cause a change to the configuration. If a rate limiter is started that is already running, an error should be thrown. If it is desired to ignore this condition, the restart should be used instead.
-
restart
public static final RateSpec.Verb restart
The restart action on a rate limiter causes it to be re-initialized as if it were just being started for the first time. This causes any accumulated wait time or time resources to be zeroed. This type of specifier can be useful, for example, when iterating on a workload with different target rates, where each iteration is independent of the others. In order to restart, a rate limiter will be configured if necessary.
-
-
Method Detail
-
values
public static RateSpec.Verb[] values()
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RateSpec.Verb valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-