MCPcopy
hub / github.com/microsoft/typescript-go / writeLoop

Method writeLoop

internal/lsp/server.go:593–603  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

591}
592
593func (s *Server) writeLoop(ctx context.Context) error {
594 for {
595 msg, err := s.outgoingQueue.Get(ctx)
596 if err != nil {
597 return err
598 }
599 if err := s.w.Write(msg); err != nil {
600 return fmt.Errorf("failed to write message: %w", err)
601 }
602 }
603}
604
605// WARNING: this should only be called in the async portion of a request handler,
606// otherwise a deadlock can occur.

Callers 2

RunMethod · 0.95

Calls 3

GetMethod · 0.65
WriteMethod · 0.65
ErrorfMethod · 0.65

Tested by 1