diff --git a/event/src/main/java/com/zfoo/event/manager/EventBus.java b/event/src/main/java/com/zfoo/event/manager/EventBus.java index db46e4f70..a9be1cb97 100644 --- a/event/src/main/java/com/zfoo/event/manager/EventBus.java +++ b/event/src/main/java/com/zfoo/event/manager/EventBus.java @@ -101,15 +101,9 @@ public static void post(IEvent event) { } for (var receiver : receivers) { switch (receiver.bus()) { - case CurrentThread: - doReceiver(receiver, event); - break; - case AsyncThread: - execute(event.executorHash(), () -> doReceiver(receiver, event)); - break; - case VirtualThread: - Thread.ofVirtual().name("virtual-" + clazz.getSimpleName()).start(ThreadUtils.safeRunnable(() -> doReceiver(receiver, event))); - break; + case CurrentThread -> doReceiver(receiver, event); + case AsyncThread -> execute(event.executorHash(), () -> doReceiver(receiver, event)); + case VirtualThread -> Thread.ofVirtual().name("virtual-on" + clazz.getSimpleName()).start(() -> doReceiver(receiver, event)); } } }