Skip to content

Commit

Permalink
feat[task]: run packet receiver task in EventBus
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed May 7, 2024
1 parent 2e2083f commit 3f89e0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/src/main/java/com/zfoo/net/anno/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public enum Task {

TaskBus,

EventBus,

NettyIO,

VirtualThread;
Expand Down
1 change: 1 addition & 0 deletions net/src/main/java/com/zfoo/net/router/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ public void dispatchByTaskExecutorHash(int taskExecutorHash, PacketReceiverTask

switch (receiver.task()) {
case TaskBus -> TaskBus.execute(taskExecutorHash, packetReceiverTask);
case EventBus -> EventBus.asyncExecute(taskExecutorHash, packetReceiverTask);
case NettyIO -> atReceiver(packetReceiverTask);
// case VirtualThread -> Thread.ofVirtual().name("virtual-at" + clazz.getSimpleName()).start(() -> atReceiver(packetReceiverTask));
}
Expand Down

0 comments on commit 3f89e0e

Please sign in to comment.