Package groovy.concurrent
Enum Class ActorOptions.StashOverflow
- All Implemented Interfaces:
Serializable,Comparable<ActorOptions.StashOverflow>,Constable
- Enclosing class:
- ActorOptions
Policy applied when
ActorContext.stash() is called and the
actor's bounded stash is already at capacity.
There is no BLOCK variant: the handler running stash()
is on the actor's only worker thread, so blocking it on stash capacity
would deadlock.
- Since:
- 6.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe oldest stashed message is evicted to make room for the current one.The current message is rejected: anysendAndGetreply is bound toIllegalStateException; any pending state change computed by the current handler is discarded; the message is not added to the stash and will not be replayed. -
Method Summary
Modifier and TypeMethodDescriptionstatic ActorOptions.StashOverflowReturns the enum constant of this class with the specified name.static ActorOptions.StashOverflow[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FAIL
ActorContext.stash()throwsIllegalStateException. The exception propagates out of the handler unless caught; if uncaught, the dispatch treats it as a normal handler failure (reply bound to the exception,onErrorfires). -
DROP_OLDEST
The oldest stashed message is evicted to make room for the current one. If the evicted message originated fromActor.sendAndGet(Object), its reply is bound toIllegalStateExceptionso the caller does not wait forever. -
REJECT
The current message is rejected: anysendAndGetreply is bound toIllegalStateException; any pending state change computed by the current handler is discarded; the message is not added to the stash and will not be replayed.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-