📜  completablefuture 异步示例 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:17.591000             🧑  作者: Mango

代码示例1
CompletableFuture.runAsync(() -> {
            try {
                TimeUnit.SECONDS.sleep(3);
                System.out.println("I'm special thread "+ContextHolder.getContext());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });