This commit is contained in:
laodaming 2023-07-26 15:15:37 +08:00
parent a896d42bc1
commit 36aad6a088
2 changed files with 19 additions and 19 deletions

View File

@ -177,25 +177,6 @@ func (w *wsConnectItem) close() {
logx.Info("websocket:", w.flag, " is closed") logx.Info("websocket:", w.flag, " is closed")
} }
// 操作连接中渲染任务的增加/删除
func (w *wsConnectItem) operationRenderTask() {
for {
select {
case <-w.closeChan:
return
case data := <-w.renderImageTaskCtlChan:
switch data.Option {
case 0: //删除
delete(w.renderImageTask, data.Key)
case 1: //新增
w.renderImageTask[data.Key] = struct{}{}
default:
}
}
}
}
// 读取输出返回给客户端 // 读取输出返回给客户端
func (w *wsConnectItem) writeLoop() { func (w *wsConnectItem) writeLoop() {
for { for {

View File

@ -23,3 +23,22 @@ func (w *wsConnectItem) SendToCloudRender(data []byte) {
} }
} }
} }
// 操作连接中渲染任务的增加/删除
func (w *wsConnectItem) operationRenderTask() {
for {
select {
case <-w.closeChan:
return
case data := <-w.renderImageTaskCtlChan:
switch data.Option {
case 0: //删除任务
delete(w.renderImageTask, data.Key)
case 1: //新增任务
w.renderImageTask[data.Key] = struct{}{}
default:
}
}
}
}