Run is the main entry point for task execution.
()
| 61 | |
| 62 | // Run is the main entry point for task execution. |
| 63 | func (c *crawler) Run() { |
| 64 | c.Pipeline.Start() |
| 65 | |
| 66 | done := make(chan bool) |
| 67 | go func() { |
| 68 | c.run() |
| 69 | close(done) |
| 70 | }() |
| 71 | |
| 72 | c.Spider.Start() |
| 73 | |
| 74 | <-done |
| 75 | |
| 76 | c.Pipeline.Stop() |
| 77 | } |
| 78 | |
| 79 | // Stop terminates the crawler and its pipeline. |
| 80 | func (c *crawler) Stop() { |