world: 一大波优化与功能更新

- fix #441
- 优化wsserver解析
- 完善 ctx.this 相关函数
- 自动已读: Config 的 MarkMessage
This commit is contained in:
源文雨
2023-07-28 13:56:48 +08:00
parent ebcd3cdef2
commit c8dcdbb0b2
11 changed files with 47 additions and 72 deletions

View File

@@ -231,6 +231,7 @@ func init() {
late := flag.Uint("l", 233, "Response latency (ms).")
rsz := flag.Uint("r", 4096, "Receiving buffer ring size.")
maxpt := flag.Uint("x", 4, "Max process time (min).")
markmsg := flag.Bool("m", false, "Don't mark message as read automatically")
flag.Parse()
@@ -277,7 +278,7 @@ func init() {
config.Z.Driver[i] = w
}
for i, s := range config.S {
config.Z.Driver[i+len(config.W)] = driver.NewWebSocketServer(16, s.Url, s.AccessToken)
config.Z.Driver[i+len(config.W)] = s
}
logrus.Infoln("[main] 从", *runcfg, "读取配置文件")
return
@@ -290,6 +291,7 @@ func init() {
RingLen: *rsz,
Latency: time.Duration(*late) * time.Millisecond,
MaxProcessTime: time.Duration(*maxpt) * time.Minute,
MarkMessage: !*markmsg,
Driver: []zero.Driver{config.W[0]},
}