simulateToolResult publishes a CommandResult to the manager after a short delay.
(mgr *sessions.Manager, sessionID string, taskID uint32, output string, delay time.Duration)
| 116 | |
| 117 | // simulateToolResult publishes a CommandResult to the manager after a short delay. |
| 118 | func 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). |
| 132 | func simulateChunkedToolResults(mgr *sessions.Manager, sessionID string, taskID uint32, outputs []string, interval time.Duration) { |
no test coverage detected