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