DistributeToModelPipelines 仅将消息分发给指定模型的管道
(model string, msg PullMessage)
| 192 | |
| 193 | // DistributeToModelPipelines 仅将消息分发给指定模型的管道 |
| 194 | func (e *AsyncExecutor) DistributeToModelPipelines(model string, msg PullMessage) { |
| 195 | e.mu.Lock() |
| 196 | defer e.mu.Unlock() |
| 197 | pipelines, ok := e.pipelines[model] |
| 198 | if !ok { |
| 199 | return |
| 200 | } |
| 201 | for _, pipeline := range pipelines.List() { |
| 202 | select { |
| 203 | case pipeline.channel <- msg: |
| 204 | default: |
| 205 | // 如果管道已满,跳过 |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | type PullCallback func(msg PullMessage) error |
| 211 |
no test coverage detected