LAPP 打印服务 支持条码打印和表单打印 通过Socket或windows打印方式
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
441 B

package Engine
import (
"LAPP_PRN_Service/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
}
}()
}