I would use task scheduling...
Beginner: Cron vs. Queues/Jobs - best practices and hints.
I'm building a small web crawler for a College class, specifically to see if sites created by students pass the 25 things they need to do (e.g. external link, link to subdomain etc etc). I figured it would be a nice little project to get me back into Laravel.
In my head, I envisioned was a cron job that ran every 10 seconds, pulling the next page not indexed form the database, but that seems such old world thinking, I thought I'd ask here for a better way of doing things, and a more Laravel way of doing things
What I am not sure of is how to "queue" the next page to be crawled, outside of a cron. I currently have it as a recursive function, effectively a '''while''' loop (while pages_crawled < pages_indexed). That isn't scalable though, and I'm hitting some timeouts already.
What I'm looking for is an idea of what the best method for this is. I've looked at Queues (http://laravel.com/docs/5.1/queues), but that seems to be overkill and i'm unsure of how I would get it to keep going until all the pages were indexed.
Would I push a new 'job' to the queue for each page to be crawled? Would I put my recursive '''while loop''' in the Queue worker, and just push a new 'job' per student site?
Thanks!
Please or to participate in this conversation.