SJA APS后端代码
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
447 B

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