MCPcopy
hub / github.com/aceld/zinx / ProceedWithIMessage

Method ProceedWithIMessage

zinterceptor/chain.go:56–76  ·  view source on GitHub ↗

Next Enter the next chain task with IMessage and decoded data,iMessage is the decoded IMessage response is the decoded data (Next 通过IMessage和解码后数据进入下一个责任链任务, iMessage 为解码后的IMessage, response 为解码后的数据)

(iMessage ziface.IMessage, response ziface.IcReq)

Source from the content-addressed store, hash-verified

54// Next Enter the next chain task with IMessage and decoded data,iMessage is the decoded IMessage response is the decoded data
55// (Next 通过IMessage和解码后数据进入下一个责任链任务, iMessage 为解码后的IMessage, response 为解码后的数据)
56func (c *Chain) ProceedWithIMessage(iMessage ziface.IMessage, response ziface.IcReq) ziface.IcResp {
57 if iMessage == nil || response == nil {
58 return c.Proceed(c.Request())
59 }
60
61 req := c.Request()
62 if req == nil {
63 return c.Proceed(c.Request())
64 }
65
66 iRequest := c.ShouldIRequest(req)
67 if iRequest == nil {
68 return c.Proceed(c.Request())
69 }
70
71 // Set the request of chain for the next request
72 // (设置chain的request下一次请求)
73 iRequest.SetResponse(response)
74
75 return c.Proceed(iRequest)
76}
77
78// ShouldIRequest Determine if it is IRequest(判断是否是IRequest)
79func (c *Chain) ShouldIRequest(icReq ziface.IcReq) ziface.IRequest {

Callers

nothing calls this directly

Calls 4

ProceedMethod · 0.95
RequestMethod · 0.95
ShouldIRequestMethod · 0.95
SetResponseMethod · 0.65

Tested by

no test coverage detected