MCPcopy Index your code
hub / github.com/github/copilot-sdk / routeChunk

Method routeChunk

go/copilot_request_handler.go:640–655  ·  view source on GitHub ↗
(exchange *pendingExchange, params *rpc.LlmInferenceHTTPRequestChunkRequest)

Source from the content-addressed store, hash-verified

638}
639
640func (a *copilotRequestAdapter) routeChunk(exchange *pendingExchange, params *rpc.LlmInferenceHTTPRequestChunkRequest) {
641 if params.Cancel != nil && *params.Cancel {
642 exchange.cancel()
643 exchange.queue.close()
644 return
645 }
646 if params.Data != "" {
647 binary := params.Binary != nil && *params.Binary
648 if data, err := decodeChunkData(params.Data, binary); err == nil {
649 exchange.queue.push(CopilotWebSocketMessage{Data: data, Binary: binary})
650 }
651 }
652 if params.End != nil && *params.End {
653 exchange.queue.close()
654 }
655}
656
657func (a *copilotRequestAdapter) runHandler(rctx *CopilotRequestContext, sink *responseSink, exchange *pendingExchange) {
658 err := a.handler.handle(rctx, sink)

Callers 1

HttpRequestChunkMethod · 0.95

Calls 4

decodeChunkDataFunction · 0.70
closeMethod · 0.65
cancelMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected