/** * Create a Promise which will be redeemed with the result of a given Function0. * * @param function Used to fulfill the Promise. * @param ec The ExecutionContext to run the function in. */ public static <A> Promise<A> promise(Function0<A> function, ExecutionContext ec) { return FPromiseHelper.promise(function, ec); }
/** * Create a Promise which will be redeemed with the result of a given function. * * <p>The Function0 will be run in the default ExecutionContext. * * @param function Used to fulfill the Promise. */ public static <A> Promise<A> promise(Function0<A> function) { return FPromiseHelper.promise(function, HttpExecution.defaultContext()); }