MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / simulateToolResult

Function simulateToolResult

internal/bridge/transfer_e2e_test.go:118–129  ·  view source on GitHub ↗

simulateToolResult publishes a CommandResult to the manager after a short delay.

(mgr *sessions.Manager, sessionID string, taskID uint32, output string, delay time.Duration)

Source from the content-addressed store, hash-verified

116
117// simulateToolResult publishes a CommandResult to the manager after a short delay.
118func simulateToolResult(mgr *sessions.Manager, sessionID string, taskID uint32, output string, delay time.Duration) {
119 go func() {
120 time.Sleep(delay)
121 mgr.PublishResult(sessionID, &sessions.CommandResult{
122 CommandID: "sim",
123 TaskID: taskID,
124 SessionID: sessionID,
125 Output: output,
126 Timestamp: time.Now(),
127 })
128 }()
129}
130
131// simulateChunkedToolResults publishes N results (one per dequeued chunk command).
132func simulateChunkedToolResults(mgr *sessions.Manager, sessionID string, taskID uint32, outputs []string, interval time.Duration) {

Calls 1

PublishResultMethod · 0.80

Tested by

no test coverage detected