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 17c8ef18e..e2fc0f44d 100644 --- a/event/src/main/java/com/zfoo/event/manager/EventBus.java +++ b/event/src/main/java/com/zfoo/event/manager/EventBus.java @@ -103,6 +103,7 @@ public static void post(IEvent event) { switch (receiver.bus()) { 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)); } } } diff --git a/net/src/main/java/com/zfoo/net/router/Router.java b/net/src/main/java/com/zfoo/net/router/Router.java index 6de20e30f..d4dc3730a 100644 --- a/net/src/main/java/com/zfoo/net/router/Router.java +++ b/net/src/main/java/com/zfoo/net/router/Router.java @@ -204,6 +204,7 @@ public void dispatchByTaskExecutorHash(int taskExecutorHash, PacketReceiverTask switch (receiver.task()) { case TaskBus -> TaskBus.execute(taskExecutorHash, packetReceiverTask); case NettyIO -> atReceiver(packetReceiverTask); +// case VirtualThread -> Thread.ofVirtual().name("virtual-at" + clazz.getSimpleName()).start(() -> atReceiver(packetReceiverTask)); } } diff --git a/protocol/src/main/java/com/zfoo/protocol/util/FastThreadLocalAdapter.java b/protocol/src/main/java/com/zfoo/protocol/util/FastThreadLocalAdapter.java index c7da17cfc..227a33b65 100644 --- a/protocol/src/main/java/com/zfoo/protocol/util/FastThreadLocalAdapter.java +++ b/protocol/src/main/java/com/zfoo/protocol/util/FastThreadLocalAdapter.java @@ -24,6 +24,7 @@ protected T initialValue() { } public T get() { +// return Thread.currentThread().isVirtual() ? supplier.get() : fastThreadLocal.get(); return fastThreadLocal.get(); } }