Getting Started with Drupal QueueWorker and Cron
In Drupal there are the QueueWorker
and QueueWorkerManager
classes that are helpful in managing a queue. One benefit of managing tasks is a queue is they offer a way of managing tasks or jobs in an orderly way. Think First in First Out.
The way the QueueWorker in Drupal works is tied in with cron.