SJA工艺
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

24 lines
452 B

package Engine
import (
"LAPP_SJA_ME/web/models"
)
// 运行调度器,从管道获取打印任务并分发给对应的打印机
func StartScheduler(inChan chan models.PrintTask, prnDict map[string]*Printer) {
// 从管道获取打印任务并分发
go func() {
var (
prn *Printer
ok bool
t models.PrintTask
)
for {
t = <-inChan
if prn, ok = prnDict[t.PrinterId]; !ok {
continue
}
prn.InTaskChan <- t
}
}()
}