Exemple #1
0
// AddArticle adds an article to the ready queue. The article will be scraped by
// a client then sent back up to the Jefe. The chan signals back to the
// schedulable article
func (j *Jefe) AddArticle(article scraper.Article, c chan int) {
	j.mutex.Lock()
	defer j.mutex.Unlock()

	log.Info("adding article", article.GetLink(), "to ready queue")
	j.queue = append(j.queue, article)

	j.openRequests[article.GetLink()] = c
	j.openArticles[article.GetLink()] = article
}