smallnest / rpcx

Best microservices framework in Go, like alibaba Dubbo, but with more features, Scale easily. Try it. Test it. If you feel it's better, use it! 𝐉𝐚𝐯𝐚有𝐝𝐮𝐛𝐛𝐨, 𝐆𝐨𝐥𝐚𝐧𝐠有𝐫𝐩𝐜𝐱! build for cloud!
https://rpcx.io
Other
8.08k stars 1.16k forks source link

feat: write separation #875

Open dickens7 opened 5 days ago

dickens7 commented 5 days ago

我们业务场景是通过 wokerpool(worker 设置为1) 将所有主逻辑都投递到一个协程中运行的, 所以我们需要异步进行写操作。 但是现在的异步写会继续投递到 workerpool中,这在我们的场景中是无意义的。

这个pr是将所有写操作投递到独立的协程中进行

https://github.com/dickens7/rpcx/blob/04390ab447af4eaad705cb5123b06e97d362aa56/server/server.go#L1114

这里需要注意,当前chan满了之后会直接丢弃消息