7 ms·
I would recommend using the "getting started" tutorial from Akka instead, it covers the exact use case: http://akka.io/docs/akka/1.1/intro/getting-started-firs
by DavidMcLaughlin 15y ago
I would recommend using the "getting started" tutorial from Akka instead, it covers the exact use case:
http://akka.io/docs/akka/1.1/intro/getting-started-first-scala.html http://akka.io/docs/akka/1.1/intro/getting-started-first-sca...
That page also has some key features including the use of PoisonPills and stop hooks to terminate all threads once the tasks are finished and sending messages betweens workers and the master actor that are missing in the OP.
Also, web crawling is an I/O bound task - so why limit the number of worker actors to the number of cores? That approach makes sense only for CPU bound tasks. The approach in the tutorial to accept number of workers as a parameter is better practice imo, so that you can tinker with it to maximise throughput for your particular problem.