Class IgnoreTaskException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.helidon.common.concurrency.limits.IgnoreTaskException
- All Implemented Interfaces:
Serializable
If this exception is thrown from a limited task within
LimitAlgorithm.invoke(java.util.concurrent.Callable)
, the
invocation will be ignored by possible algorithms (for example when considering round-trip timing).
This should be used for cases where we never got to execute the intended task.
This exception should never be thrown by Limit
, it should always
be translated to a proper return type, or actual exception.
- See Also:
-
Constructor Summary
ConstructorDescriptionIgnoreTaskException
(Exception cause) Create a new instance with a cause.IgnoreTaskException
(Object returnValue) Create a new instance with a return value. -
Method Summary
Modifier and TypeMethodDescription<T> T
handle()
This is used by limit implementations to either return the value, or throw an exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
IgnoreTaskException
Create a new instance with a cause.- Parameters:
cause
- the cause of this exception
-
IgnoreTaskException
Create a new instance with a return value.- Parameters:
returnValue
- value to return, even though this invocation should be ignored return value may benull
.
-
-
Method Details
-
handle
This is used by limit implementations to either return the value, or throw an exception.- Type Parameters:
T
- type of the return value- Returns:
- the value provided to be the return value
- Throws:
Exception
- exception provided by the task
-