MCPcopy
hub / github.com/wavetermdev/waveterm / stdinReadWatch

Function stdinReadWatch

cmd/server/main-server.go:100–112  ·  view source on GitHub ↗

watch stdin, kill server if stdin is closed

()

Source from the content-addressed store, hash-verified

98
99// watch stdin, kill server if stdin is closed
100func stdinReadWatch() {
101 defer func() {
102 panichandler.PanicHandler("stdinReadWatch", recover())
103 }()
104 buf := make([]byte, 1024)
105 for {
106 _, err := os.Stdin.Read(buf)
107 if err != nil {
108 doShutdown(fmt.Sprintf("stdin closed/error (%v)", err))
109 break
110 }
111 }
112}
113
114func startConfigWatcher() {
115 watcher := wconfig.GetWatcher()

Callers 1

mainFunction · 0.85

Calls 3

PanicHandlerFunction · 0.92
doShutdownFunction · 0.85
ReadMethod · 0.45

Tested by

no test coverage detected