wikirace
Program that performs a wikiracing.
Install
go get -u github.com/maxence-charriere/wikirace
Build
# go in $GOPATH/src/github.com/maxence-charriere/wikirace/bin/wikirace directory
go build
Usage
./wikirace -start [TITLE TO START] -end [TITLE TO REACH]
What the code does?
- Generate a Search object that describe a page to search in from the command line args.
- Create the different parts to make the program work:
- An object that keep informations about the jobs (current and processed)
- A queue to store the Search objects to process.
- A thread pool that launch search job in paralel.
- A result handler that analyses job results.
- Put the Search object into the queue.
- Searchs are dequeued and processed in a threadpool.
- For each Search Object dequeued:
- Page download
- Page parsing
- Each link found generate a new Search object which is sent to the result handler.
- Result handler listen for new Search objects. Then Decides to validate a Search object or to put it in the queue for more searching.