MCPcopy Index your code
hub / github.com/aceld/zinx / Poll1

Function Poll1

examples/zinx_RequestPollMode/pool_mode_server/PoolModeServer.go:12–24  ·  view source on GitHub ↗
(request ziface.IRequest)

Source from the content-addressed store, hash-verified

10)
11
12func Poll1(request ziface.IRequest) {
13 // 如果需要连接信息
14 request.Set("conn", request.GetConnection())
15 request.Set("num", 1)
16 fmt.Printf("request 1 addr:%p,conn:%p \n", &request, request.GetConnection())
17
18 // 需要新线程同时也需要上下文的情况,则需要调用 copy 方法拷贝一份
19 cp := request.Copy()
20 go Poll2(cp)
21
22 // 如果不使用 copy 方法拷贝对象则会出现同一个对象但是信息可能不一致的问题,不启动 poll2 会更直接
23 go Poll3(request)
24}
25
26func Poll2(request ziface.IRequest) {
27 defer func() {

Callers

nothing calls this directly

Calls 5

Poll2Function · 0.85
Poll3Function · 0.85
SetMethod · 0.65
GetConnectionMethod · 0.65
CopyMethod · 0.65

Tested by

no test coverage detected