We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If you r going to wait response,or block the goroutine in a getty session(tcp conection), task pool can not be null。
func (s *Server) newSession(session getty.Session) error { var ( ok bool tcpConn *net.TCPConn ) // 省略部分代码... session.SetTaskPool(srvGrpool) return nil }
ortherwise,handleTcpPackage() will blocked,led to the response missing
func (s *session) addTask(pkg interface{}) { f := func() { s.listener.OnMessage(s, pkg) s.incReadPkgNum() } if s.tPool != nil { s.tPool.AddTask(f) return } f() }
The text was updated successfully, but these errors were encountered:
这种情况啊,第一你用我的task pool,但是最终还是受限于 gxsync.TaskPoolOptions {tQLen, tQNumber, tQPoolSize}; 第二,不用我的task pool,在你的 OnMessage 中快速调用 go,也能实现同样的 业务和网络处理分离,分离参数你自己控制。
Sorry, something went wrong.
这个 taskpool 还有一个问题,add 的 task 方法,需要一个兜底的 defer 去解决 panic,如果没有这个兜底的 defer 的话,task 方法 panic 后,进入 gxruntime.GoSafely 的 defer,执行完这个 goroutine 就关闭了,然后这个 taskpool 就会再加 task 的话,会加到 p.qArray[i] 某个 chan,这个 chan 永远没有 goroutine 去消费他的 task。
No branches or pull requests
If you r going to wait response,or block the goroutine in a getty session(tcp conection), task pool can not be null。
ortherwise,handleTcpPackage() will blocked,led to the response missing
The text was updated successfully, but these errors were encountered: