AwaitResult returns the task's result channel for reading. Callers should read from this channel to receive results routed by the fan-out.
(sessionID string, taskID uint32)
| 191 | // AwaitResult returns the task's result channel for reading. |
| 192 | // Callers should read from this channel to receive results routed by the fan-out. |
| 193 | func (tm *TaskManager) AwaitResult(sessionID string, taskID uint32) <-chan *sessions.CommandResult { |
| 194 | task := tm.Get(sessionID, taskID) |
| 195 | if task == nil { |
| 196 | return nil |
| 197 | } |
| 198 | return task.resultCh |
| 199 | } |
| 200 | |
| 201 | // Complete marks a task as completed and closes its result channel. |
| 202 | func (tm *TaskManager) Complete(sessionID string, taskID uint32) { |