Package | Description |
---|---|
org.dromara.hutool.core.lang.event |
发布订阅模式封装,发布/订阅是一种消息范式
消息的发送者(EventPublisher)将事件或消息(Event)广播出去,订阅者(Subscriber)接收到消息后处理。 |
Modifier and Type | Method and Description |
---|---|
static SimpleEventPublisher |
SimpleEventPublisher.of()
创建一个默认的
SimpleEventPublisher ,默认线程池为ThreadUtil.newExecutor() |
static SimpleEventPublisher |
SimpleEventPublisher.of(List<Subscriber> subscribers)
创建一个默认的
SimpleEventPublisher ,默认线程池为ThreadUtil.newExecutor() |
SimpleEventPublisher |
SimpleEventPublisher.setExecutorService(ExecutorService executorService)
设置自定义的
ExecutorService 线程池,默认为ThreadUtil.newExecutor() |
Copyright © 2025. All rights reserved.