/** * Runs an action in a new fiber and awaits the fiber's termination. * The new fiber is scheduled by the {@link DefaultFiberScheduler default scheduler}. * . * * @param target the operation * @throws ExecutionException * @throws InterruptedException */ public static void runInFiber(SuspendableRunnable target) throws ExecutionException, InterruptedException { FiberUtil.runInFiber(target); }
/** * Runs an action in a new fiber and awaits the fiber's termination. * * @param scheduler the {@link FiberScheduler} to use when scheduling the fiber. * @param target the operation * @throws ExecutionException * @throws InterruptedException */ public static void runInFiber(FiberScheduler scheduler, SuspendableRunnable target) throws ExecutionException, InterruptedException { FiberUtil.runInFiber(scheduler, target); }
/** * Runs an action in a new fiber, awaits the fiber's termination, and returns its result. * The new fiber is scheduled by the {@link DefaultFiberScheduler default scheduler}. * * @param <V> * @param target the operation * @return the operations return value * @throws ExecutionException * @throws InterruptedException */ public static <V> V runInFiber(SuspendableCallable<V> target) throws ExecutionException, InterruptedException { return FiberUtil.runInFiber(target); }
/** * Runs an action in a new fiber, awaits the fiber's termination, and returns its result. * * @param <V> * @param scheduler the {@link FiberScheduler} to use when scheduling the fiber. * @param target the operation * @return the operations return value * @throws ExecutionException * @throws InterruptedException */ public static <V> V runInFiber(FiberScheduler scheduler, SuspendableCallable<V> target) throws ExecutionException, InterruptedException { return FiberUtil.runInFiber(scheduler, target); }
/** * Runs an action in a new fiber and awaits the fiber's termination. * The new fiber is scheduled by the {@link DefaultFiberScheduler default scheduler}. * . * * @param target the operation * @throws ExecutionException * @throws InterruptedException */ public static void runInFiber(SuspendableRunnable target) throws ExecutionException, InterruptedException { runInFiber(DefaultFiberScheduler.getInstance(), target); }
/** * Runs an action in a new fiber, awaits the fiber's termination, and returns its result. * The new fiber is scheduled by the {@link DefaultFiberScheduler default scheduler}. * * @param <V> * @param target the operation * @return the operations return value * @throws ExecutionException * @throws InterruptedException */ public static <V> V runInFiber(SuspendableCallable<V> target) throws ExecutionException, InterruptedException { return runInFiber(DefaultFiberScheduler.getInstance(), target); }