- java.lang.Object
-
- io.netty5.util.concurrent.RejectedExecutionHandlers
-
public final class RejectedExecutionHandlers extends Object
Expose helper methods which create differentRejectedExecutionHandler
s.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RejectedExecutionHandler
backoff(int retries, long backoffAmount, TimeUnit unit)
Tries to backoff when the task can not be added due restrictions for an configured amount of time.static RejectedExecutionHandler
reject()
Returns aRejectedExecutionHandler
that will always just throw aRejectedExecutionException
.
-
-
-
Method Detail
-
reject
public static RejectedExecutionHandler reject()
Returns aRejectedExecutionHandler
that will always just throw aRejectedExecutionException
.
-
backoff
public static RejectedExecutionHandler backoff(int retries, long backoffAmount, TimeUnit unit)
Tries to backoff when the task can not be added due restrictions for an configured amount of time. This is only done if the task was added from outside of the event loop which meansEventExecutor.inEventLoop()
returnsfalse
.
-
-