Example #1
0
func (p *Parser) Close() {
	log.Debug("Closing %s Parser", p.String())
	log.Debug("Closing %s Parser:setupFileDefer", p.String())
	p.setupFileDefer()
	log.Debug("Closing %s Parser:recordInsert", p.String())
	p.recordInsert.Close()
	log.Debug("Closing %s Parser:domainInsert", p.String())
	p.domainInsert.Close()
	log.Debug("Closed %s Parser", p.String())
	p.Update("Parse finished.")
	p.Finish()
}
Example #2
0
func (w Worker) Start() {
	go func() {
		for {
			// register with dispatcher
			w.WorkerQueue <- w.Work

			select {
			case work := <-w.Work:
				work.Do(w)

			case <-w.QuitChan:
				log.Debug("worker%d: quit", w.ID)
				return
			}
		}
	}()
}