@Test public void asyncLeft(@Mock Consumer1<? super Try<? extends Integer>> callback) { parseInt("kjsdf").safeRunAsync(callback); verify(callback, timeout(500)).accept(captor.capture()); assertEquals(NumberFormatException.class, captor.getValue().getCause().getClass()); }
public void safeRunAsync(Executor executor, Consumer1<? super Try<? extends A>> callback) { instance.provideAsync(executor, nothing(), result -> callback.accept(flatAbsorb(result))); }
Task implements TaskOf<A>, Recoverable { public void safeRunAsync(Executor executor, Consumer1<? super Try<? extends A>> callback) { instance.provideAsync(executor, nothing(), result -> callback.accept(flatAbsorb(result))); } }
Task implements TaskOf<A>, Recoverable { public void safeRunAsync(Executor executor, Consumer1<? super Try<? extends A>> callback) { instance.provideAsync(executor, nothing(), result -> callback.accept(flatAbsorb(result))); } Task(ZIO<Nothing, Throwable, A> value); }
Task implements TaskOf<A>, Recoverable { public void safeRunAsync(Executor executor, Consumer1<? super Try<? extends A>> callback) { instance.provideAsync(executor, nothing(), result -> callback.accept(flatAbsorb(result))); } Task(ZIO<Nothing, Throwable, A> value); @SuppressWarnings("unchecked") ZIO<R, Throwable, A> toZIO(); EIO<Throwable, A> toEIO(); @SuppressWarnings("unchecked") RIO<R, A> toURIO(); UIO<A> toUIO(); Try<A> safeRunSync(); Future<Try<A>> toFuture(); Future<Try<A>> toFuture(Executor executor); void safeRunAsync(Executor executor, Consumer1<? super Try<? extends A>> callback); void safeRunAsync(Consumer1<? super Try<? extends A>> callback); Kind<F, A> foldMap(Async<F> monad); Task<B> map(Function1<? super A, ? extends B> map); Task<B> flatMap(Function1<? super A, ? extends Task<? extends B>> map); Task<B> andThen(Task<? extends B> next); Task<B> ap(Task<Function1<? super A, ? extends B>> apply); Task<B> foldM(
      Function1<? super Throwable, ? extends Task<? extends B>> mapError, 
      Function1<? super A, ? extends Task<? extends B>> map); UIO<B> fold(
      Function1<? super Throwable, ? extends B> mapError, Function1<? super A, ? extends B> map); @SuppressWarnings("unchecked") UIO<A> recoverWith(Class<X> type, Function1<? super X, ? extends A> function); UIO<A> recover(Function1<? super Throwable, ? extends A> mapError); Task<A> orElse(Task<? extends A> other); Task<Tuple2<A, B>> zip(Task<? extends B> other); Task<A> zipLeft(Task<? extends B> other); Task<B> zipRight(Task<? extends B> other); Task<C> zipWith(Task<? extends B> other, 
      Function2<? super A, ? super B, ? extends C> mapper); Task<A> repeat(); Task<A> repeat(int times); Task<A> repeat(Duration delay); Task<A> repeat(Duration delay, int times); Task<B> repeat(Schedule<Nothing, A, B> schedule); Task<A> retry(); Task<A> retry(int maxRetries); Task<A> retry(Duration delay); Task<A> retry(Duration delay, int maxRetries); Task<A> retry(Schedule<Nothing, Throwable, B> schedule); Task<Tuple2<Duration, A>> timed(); static Task<C> map2(Task<? extends A> za, Task<? extends B> zb, 
      Function2<? super A, ? super B, ? extends C> mapper); static Task<A> absorb(Task<Either<Throwable, A>> value); static Function1<A, Task<B>> lift(Function1<? super A, ? extends B> function); static Task<A> fromEither(Producer<Either<Throwable, ? extends A>> task); static Task<Unit> sleep(Duration delay); static Task<Unit> exec(CheckedRunnable task); static Task<A> pure(A value); static Task<A> defer(Producer<Task<? extends A>> lazy); static Task<A> task(Producer<? extends A> task); static Task<A> async(Consumer1<Consumer1<? super Try<? extends A>>> consumer); static Task<A> asyncF(Function1<Consumer1<? super Try<? extends A>>, UIO<Unit>> consumer); static Task<A> raiseError(Throwable error); static Task<B> bracket(
      Task<? extends A> acquire, Function1<? super A, ? extends Task<? extends B>> use); static Task<B> bracket(
      Task<? extends A> acquire, Function1<? super A, ? extends Task<? extends B>> use, Consumer1<? super A> release); static Task<Unit> unit(); }
Task implements TaskOf<A>, Recoverable { public void safeRunAsync(Executor executor, Consumer1<? super Try<? extends A>> callback) { instance.provideAsync(executor, nothing(), result -> callback.accept(flatAbsorb(result))); } Task(ZIO<Nothing, Throwable, A> value); @SuppressWarnings("unchecked") ZIO<R, Throwable, A> toZIO(); EIO<Throwable, A> toEIO(); @SuppressWarnings("unchecked") RIO<R, A> toURIO(); UIO<A> toUIO(); Try<A> safeRunSync(); Future<Try<A>> toFuture(); Future<Try<A>> toFuture(Executor executor); void safeRunAsync(Executor executor, Consumer1<? super Try<? extends A>> callback); void safeRunAsync(Consumer1<? super Try<? extends A>> callback); Kind<F, A> foldMap(Async<F> monad); Task<B> map(Function1<? super A, ? extends B> map); Task<B> flatMap(Function1<? super A, ? extends Task<? extends B>> map); Task<B> andThen(Task<? extends B> next); Task<B> ap(Task<Function1<? super A, ? extends B>> apply); Task<B> foldM(
      Function1<? super Throwable, ? extends Task<? extends B>> mapError, 
      Function1<? super A, ? extends Task<? extends B>> map); UIO<B> fold(
      Function1<? super Throwable, ? extends B> mapError, Function1<? super A, ? extends B> map); @SuppressWarnings("unchecked") UIO<A> recoverWith(Class<X> type, Function1<? super X, ? extends A> function); UIO<A> recover(Function1<? super Throwable, ? extends A> mapError); Task<A> orElse(Task<? extends A> other); Task<Tuple2<A, B>> zip(Task<? extends B> other); Task<A> zipLeft(Task<? extends B> other); Task<B> zipRight(Task<? extends B> other); Task<C> zipWith(Task<? extends B> other, 
      Function2<? super A, ? super B, ? extends C> mapper); Task<A> repeat(); Task<A> repeat(int times); Task<A> repeat(Duration delay); Task<A> repeat(Duration delay, int times); Task<B> repeat(Schedule<Nothing, A, B> schedule); Task<A> retry(); Task<A> retry(int maxRetries); Task<A> retry(Duration delay); Task<A> retry(Duration delay, int maxRetries); Task<A> retry(Schedule<Nothing, Throwable, B> schedule); Task<Tuple2<Duration, A>> timed(); static Task<C> map2(Task<? extends A> za, Task<? extends B> zb, 
      Function2<? super A, ? super B, ? extends C> mapper); static Task<A> absorb(Task<Either<Throwable, A>> value); static Function1<A, Task<B>> lift(Function1<? super A, ? extends B> function); static Task<A> fromEither(Producer<Either<Throwable, ? extends A>> task); static Task<Unit> sleep(Duration delay); static Task<Unit> exec(CheckedRunnable task); static Task<A> pure(A value); static Task<A> defer(Producer<Task<? extends A>> lazy); static Task<A> task(Producer<? extends A> task); static Task<A> async(Consumer1<Consumer1<? super Try<? extends A>>> consumer); static Task<A> asyncF(Function1<Consumer1<? super Try<? extends A>>, UIO<Unit>> consumer); static Task<A> raiseError(Throwable error); static Task<B> bracket(
      Task<? extends A> acquire, Function1<? super A, ? extends Task<? extends B>> use); static Task<B> bracket(
      Task<? extends A> acquire, Function1<? super A, ? extends Task<? extends B>> use, Consumer1<? super A> release); static Task<Unit> unit();  }