Пример #1
0
func NewRombaService(romDB db.RomDB, depot *archive.Depot, dats string, numWorkers int, logDir string) *RombaService {
	rs := new(RombaService)
	rs.romDB = romDB
	rs.depot = depot
	rs.dats = dats
	rs.logDir = logDir
	rs.numWorkers = numWorkers
	rs.pt = worker.NewProgressTracker()
	rs.jobMutex = new(sync.Mutex)
	rs.progressMutex = new(sync.Mutex)
	rs.progressListeners = make(map[string]chan *ProgressNessage)
	return rs
}
Пример #2
0
func NewRombaService(romDB db.RomDB, depot *archive.Depot, cfg *config.Config) *RombaService {
	glog.Info("Service init")
	rs := new(RombaService)
	rs.romDB = romDB
	rs.depot = depot
	rs.dats = cfg.Index.Dats
	rs.logDir = cfg.General.LogDir
	rs.numWorkers = cfg.General.Workers
	rs.pt = worker.NewProgressTracker(rs.numWorkers)
	rs.jobMutex = new(sync.Mutex)
	rs.progressMutex = new(sync.Mutex)
	rs.progressListeners = make(map[string]chan *ProgressNessage)
	glog.Info("Service init finished")
	return rs
}
Пример #3
0
func (pm *parseMaster) ProgressTracker() worker.ProgressTracker {
	return worker.NewProgressTracker()
}