public final class ScopeUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
runAsyncWithCurrentScope(Runnable runnable,
Executor executor) |
static com.google.common.util.concurrent.ListenableFuture<?> |
runAsyncWithCurrentScope(Runnable runnable,
com.google.common.util.concurrent.ListeningExecutorService executor) |
static <U> Future<U> |
supplyAsyncWithCurrentScope(Supplier<U> supplier,
ExecutorService executor) |
static <U> com.google.common.util.concurrent.ListenableFuture<U> |
supplyAsyncWithCurrentScope(Supplier<U> supplier,
com.google.common.util.concurrent.ListeningExecutorService executor) |
static LongCostTrack |
trackLongCost(Duration timeoutForReport,
Consumer<Duration> onTimeoutReportRunnable) |
public static void runAsyncWithCurrentScope(@Nonnull Runnable runnable, @Nonnull Executor executor)
@Nonnull public static com.google.common.util.concurrent.ListenableFuture<?> runAsyncWithCurrentScope(@Nonnull Runnable runnable, @Nonnull com.google.common.util.concurrent.ListeningExecutorService executor)
@Nonnull public static <U> Future<U> supplyAsyncWithCurrentScope(@Nonnull Supplier<U> supplier, @Nonnull ExecutorService executor)
@Nonnull public static <U> com.google.common.util.concurrent.ListenableFuture<U> supplyAsyncWithCurrentScope(@Nonnull Supplier<U> supplier, @Nonnull com.google.common.util.concurrent.ListeningExecutorService executor)
public static LongCostTrack trackLongCost(Duration timeoutForReport, Consumer<Duration> onTimeoutReportRunnable)
onTimeoutReportRunnable - accept a time duration in nano-seconds.Copyright © 2019. All rights reserved.