Skip to content

定义MessageSender,将websocket.send进行统一管理 #1463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

myifeng
Copy link
Contributor

@myifeng myifeng commented Jun 4, 2025

No description provided.

@openrz
Copy link
Collaborator

openrz commented Jun 4, 2025

大佬,希望能更彻底一点,[微笑]比如传参数,不能写json.dumps(self.welcome_msg)
1、全部把json.dumps放在message_sender内部处理,里更合适
2、定义发送消息的dto,传值的时候传dto

可能会更好一点。

@myifeng
Copy link
Contributor Author

myifeng commented Jun 4, 2025

大佬,希望能更彻底一点,[微笑]比如传参数,不能写json.dumps(self.welcome_msg)

1、全部把json.dumps放在message_sender内部处理,里更合适

2、定义发送消息的dto,传值的时候传dto

可能会更好一点。

我可以理解这点。目前这个是第一步,message sender是比较方便优化的。

下一步会优化message handler,定义统一的返回结构。就是你说的dto,这个工作量会大一些,这里是耦合重灾区

最终目标肯定是完成handler --> dto --> sender链路

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants