Future是异步计算的结果表示,与NodeJS中的Promise类似。继承了两种能力:异步任务和流水线处理。类图三种常用关系串行关系并行关系汇总关系CompletableFuture基本使用创建异步任务有返回的异步任务@TestpublicvoidsupplyAsync()throwsExecutionException,InterruptedException{CompletableFutureboil=CompletableFuture.supplyAsync(()->{try{TimeUnit.SECONDS.sleep(2);return"烧水";}catch(Interrupted