com.google.common.util.concurrent.TimeLimiter

Here are the examples of the java api class com.google.common.util.concurrent.TimeLimiter taken from open source projects.

1. TimeoutBackupStore#timeLimited()

Project: presto
Source File: TimeoutBackupStore.java
View license
private static <T> T timeLimited(T target, Class<T> clazz, Duration timeout, ExecutorService executor, int maxThreads) {
    executor = new ExecutorServiceAdapter(new BoundedExecutor(executor, maxThreads));
    TimeLimiter limiter = new SimpleTimeLimiter(executor);
    return limiter.newProxy(target, clazz, timeout.toMillis(), MILLISECONDS);
}