Skip to content

从旧版本迁移中遇到的一些问题 #144

Answered by shigma
H4M5TER asked this question in Q&A
Discussion options

You must be logged in to vote

1.1 为什么协议和 id 是 Bot 分别持有的,而监听端口是整个 App 持有的?

首先协议和 id 是每个 bot 分别持有的是很自然的一件事。监听端口作为 App 的配置项是出于性能考虑。开放尽可能少的端口,合并尽可能多的服务能够提高资源的利用率。Koishi 内置了 Koa 作为服务端框架,通过 Router 可以有效实现内容的分流。

如果您需要开放多个端口,可以单独开一个 feat request,描述您的使用场景,我会考虑加入对应的支持。

Replies: 7 comments 7 replies

Comment options

H4M5TER
Mar 5, 2021
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@H4M5TER
Comment options

H4M5TER Mar 6, 2021
Collaborator Author

@shigma
Comment options

@H4M5TER
Comment options

H4M5TER Mar 6, 2021
Collaborator Author

Answer selected by H4M5TER
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@H4M5TER
Comment options

H4M5TER Mar 6, 2021
Collaborator Author

@shigma
Comment options

@H4M5TER
Comment options

H4M5TER Mar 6, 2021
Collaborator Author

@shigma
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants