扣丁H5大前端全棧
靜態(tài)工廠方法
這兩個方法可以幫助我們封裝計算邏輯
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);
標(biāo)簽: