NewManager returns the new manager object.
(config *config.Config, db *gorp.DbMap)
| 68 | |
| 69 | // NewManager returns the new manager object. |
| 70 | func NewManager(config *config.Config, db *gorp.DbMap) *Manager { |
| 71 | return &Manager{ |
| 72 | config: config, |
| 73 | db: db, |
| 74 | killCh: make(chan int64), |
| 75 | waitCh: make(chan *waitItem), |
| 76 | waitMap: make(map[int64][]*waitItem), |
| 77 | taskMap: make(map[int64]*taskItem), |
| 78 | finishCh: make(chan int64), |
| 79 | newCh: make(chan *model.Task), |
| 80 | handleMap: make(map[model.TaskType]HandleFunc), |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | // Start runs the manager task scheduling. |
| 85 | func (m *Manager) Start() { |