扣丁H5大前端全栈
静态工厂方法
这两个方法可以帮助我们封装计算逻辑
static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier);// 使用自定义线程池(推荐)static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier, Executor executor);static CompletableFuture<Void> runAsync(Runnable runnable);// 使用自定义线程池(推荐)static CompletableFuture<Void> runAsync(Runnable runnable, Executor executor);