MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / handleRequest

Method handleRequest

abci/server/socket_server.go:194–242  ·  view source on GitHub ↗
(req *types.Request, responses chan<- *types.Response)

Source from the content-addressed store, hash-verified

192}
193
194func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types.Response) {
195 switch r := req.Value.(type) {
196 case *types.Request_Echo:
197 responses <- types.ToResponseEcho(r.Echo.Message)
198 case *types.Request_Flush:
199 responses <- types.ToResponseFlush()
200 case *types.Request_Info:
201 res := s.app.Info(*r.Info)
202 responses <- types.ToResponseInfo(res)
203 case *types.Request_SetOption:
204 res := s.app.SetOption(*r.SetOption)
205 responses <- types.ToResponseSetOption(res)
206 case *types.Request_DeliverTx:
207 res := s.app.DeliverTx(*r.DeliverTx)
208 responses <- types.ToResponseDeliverTx(res)
209 case *types.Request_CheckTx:
210 res := s.app.CheckTx(*r.CheckTx)
211 responses <- types.ToResponseCheckTx(res)
212 case *types.Request_Commit:
213 res := s.app.Commit()
214 responses <- types.ToResponseCommit(res)
215 case *types.Request_Query:
216 res := s.app.Query(*r.Query)
217 responses <- types.ToResponseQuery(res)
218 case *types.Request_InitChain:
219 res := s.app.InitChain(*r.InitChain)
220 responses <- types.ToResponseInitChain(res)
221 case *types.Request_BeginBlock:
222 res := s.app.BeginBlock(*r.BeginBlock)
223 responses <- types.ToResponseBeginBlock(res)
224 case *types.Request_EndBlock:
225 res := s.app.EndBlock(*r.EndBlock)
226 responses <- types.ToResponseEndBlock(res)
227 case *types.Request_ListSnapshots:
228 res := s.app.ListSnapshots(*r.ListSnapshots)
229 responses <- types.ToResponseListSnapshots(res)
230 case *types.Request_OfferSnapshot:
231 res := s.app.OfferSnapshot(*r.OfferSnapshot)
232 responses <- types.ToResponseOfferSnapshot(res)
233 case *types.Request_LoadSnapshotChunk:
234 res := s.app.LoadSnapshotChunk(*r.LoadSnapshotChunk)
235 responses <- types.ToResponseLoadSnapshotChunk(res)
236 case *types.Request_ApplySnapshotChunk:
237 res := s.app.ApplySnapshotChunk(*r.ApplySnapshotChunk)
238 responses <- types.ToResponseApplySnapshotChunk(res)
239 default:
240 responses <- types.ToResponseException("Unknown request")
241 }
242}
243
244// Pull responses from 'responses' and write them to conn.
245func (s *SocketServer) handleResponses(closeConn chan error, conn io.Writer, responses <-chan *types.Response) {

Callers 1

handleRequestsMethod · 0.95

Calls 15

ToResponseEchoFunction · 0.92
ToResponseFlushFunction · 0.92
ToResponseInfoFunction · 0.92
ToResponseSetOptionFunction · 0.92
ToResponseDeliverTxFunction · 0.92
ToResponseCheckTxFunction · 0.92
ToResponseCommitFunction · 0.92
ToResponseQueryFunction · 0.92
ToResponseInitChainFunction · 0.92
ToResponseBeginBlockFunction · 0.92
ToResponseEndBlockFunction · 0.92
ToResponseListSnapshotsFunction · 0.92

Tested by

no test coverage detected