聊聊reactive streams的schedulers
序 本文主要研究一下reactive streams的schedulers 背景 默认情况下Mono以及Flux都在主线程上运行,有时候可能会阻塞主线程,可以通过设定schedulers让其在其他线程运行。 原始输出 没有使用publishOn及subscribeOn时输出如下 11:26:10.668 [main] DEBUG reactor.util.Loggers$LoggerFactory - Using Slf4j logging framework 11:26:11.097 [main] INFO com.example.demo.SchedulerTest - defer thread:[main] 11:26:11.116 [main] INFO com.example.demo.SchedulerTest - filter thread:[main] 11:26:11.116 [main] INFO com.example.demo.SchedulerTest - filter thread:[main] 11:26:11.116 [main] INFO com.example.demo.SchedulerTest - subscribe thread:[main],data :2 11:26:11.116 [main] INFO com.example.demo