public class Timeouts extends Object
| Constructor and Description |
|---|
Timeouts() |
| Modifier and Type | Method and Description |
|---|---|
static void |
doWithTimeout(int timeout,
@NotNull TimeUnit timeUnit,
@NotNull Runnable lambda)
Execute a lambda expression with a timeout.
|
static <T> T |
getWithTimeout(int timeout,
TimeUnit timeUnit,
@NotNull Callable<T> lambda)
Execute a lambda expression with a timeout.
|
public static <T> T getWithTimeout(int timeout,
TimeUnit timeUnit,
@NotNull
@NotNull Callable<T> lambda)
T - return type of the lambdatimeout - how long to waittimeUnit - time unit for time intervallambda - supplier lambda expression (may throw checked exceptions)public static void doWithTimeout(int timeout,
@NotNull
@NotNull TimeUnit timeUnit,
@NotNull
@NotNull Runnable lambda)
timeout - how long to waittimeUnit - time unit for time intervallambda - supplier lambda expression (may throw checked exceptions)Copyright © 2019. All rights reserved.