doc[net]: 更新文档

This commit is contained in:
jaysunxiao
2021-10-17 10:41:29 +08:00
parent 786a0f051e
commit 40f04879cc
5 changed files with 9 additions and 5 deletions
+5 -1
View File
@@ -14,4 +14,8 @@
- 基于interface的不够灵活,不方便
- 然interface写同步rpc比较方便,不适合异步的写法。现在流行异步调用链的写法,基于interface有点过时了
- 并不是所有编程语言都有interface的,你用了interface的话其它编程语言就没法用了,就无法跨平台了
- 基于packet的容易扩展,可以轻易跨平台
- 基于packet的容易扩展,可以轻易跨平台
#### 接下来的计划
- 参看一下akka的actor实现,进一步优化net的线程模型,统一异步回调的argument参数
@@ -132,7 +132,7 @@ public class NetContext implements ApplicationListener<ApplicationContextEvent>,
AbstractClient.shutdown();
AbstractServer.shutdownAllServers();
// 关闭TaskManager
// 关闭TaskBus
try {
Field field = TaskBus.class.getDeclaredField("executors");
ReflectionUtils.makeAccessible(field);
@@ -43,7 +43,7 @@ public class GatewayPacketAttachment implements IPacketAttachment {
*/
private boolean useExecutorConsistentHash;
/**
* 用来在TaskManage中计算一致性hash的参数
* 用来在TaskBus中计算一致性hash的参数
*/
private int executorConsistentHash;
@@ -24,7 +24,7 @@ public class NoAnswerAttachment implements IPacketAttachment {
public static final transient short PROTOCOL_ID = 4;
/**
* 用来在TaskManage中计算一致性hash的参数
* 用来在TaskBus中计算一致性hash的参数
*/
private int executorConsistentHash;
@@ -37,7 +37,7 @@ public class SignalPacketAttachment implements IPacketAttachment {
private int packetId = ATOMIC_PACKET_ID.incrementAndGet();
/**
* 用来在TaskManage中计算一致性hash的参数
* 用来在TaskBus中计算一致性hash的参数
*/
private int executorConsistentHash = -1;