示例#1
0
 @Override
 public Promise<Void> thenAccept(Consumer<? super T> fn) {
   final java.util.function.Consumer<T> consumer =
       (a) -> {
         try {
           fn.accept(a);
         } catch (Exception e) {
           throw new PromiseRuntimeException(e);
         }
       };
   return w(f.thenAcceptAsync(consumer, promiseExecuter));
 }
示例#2
0
 @Override
 public Promise<Void> acceptEither(Promise<? extends T> other, Consumer<? super T> fn) {
   final java.util.function.Consumer<? super T> action =
       (t) -> {
         try {
           fn.accept(t);
         } catch (Exception e) {
           throw new PromiseRuntimeException(e);
         }
       };
   return w(f.acceptEitherAsync(v(other), action, promiseExecuter));
 }