MCPcopy Create free account
hub / github.com/CPChain/chain / ServeSingleRequest

Method ServeSingleRequest

api/rpc/server.go:225–227  ·  view source on GitHub ↗

ServeSingleRequest reads and processes a single RPC request from the given codec. It will not close the codec unless a non-recoverable error has occurred. Note, this method will return after a single request has been processed!

(ctx context.Context, codec ServerCodec, options CodecOption)

Source from the content-addressed store, hash-verified

223// close the codec unless a non-recoverable error has occurred. Note, this method will return after
224// a single request has been processed!
225func (s *Server) ServeSingleRequest(ctx context.Context, codec ServerCodec, options CodecOption) {
226 s.serveRequest(ctx, codec, true, options)
227}
228
229// Stop will stop reading new requests, wait for stopPendingRequestTimeout to allow pending requests to finish,
230// close all codecs which will cancel pending requests/subscriptions.

Callers 1

ServeHTTPMethod · 0.95

Calls 1

serveRequestMethod · 0.95

Tested by

no test coverage detected