MCPcopy Index your code
hub / github.com/keploy/keploy / SetOutputChannel

Method SetOutputChannel

pkg/agent/proxy/syncMock/syncMock.go:254–261  ·  view source on GitHub ↗

SetOutputChannel plugs an outgoing mock channel into the manager. Only resets outChanClosed when the channel pointer changes — re-setting the same pointer after CloseOutChan must NOT reopen the closed flag, otherwise a subsequent send would hit a post-close channel and panic. The proxy calls this on

(out chan<- *models.Mock)

Source from the content-addressed store, hash-verified

252// A distinct channel pointer means a new session (re-record), and
253// only then do we clear the closed flag.
254func (m *SyncMockManager) SetOutputChannel(out chan<- *models.Mock) {
255 m.outChanMu.Lock()
256 defer m.outChanMu.Unlock()
257 if out != m.outChan {
258 m.outChan = out
259 m.outChanClosed = false
260 }
261}
262
263func (m *SyncMockManager) SetMappingChannel(ch chan<- models.TestMockMapping) {
264 m.mu.Lock()

Calls

no outgoing calls