There's an extension called "org.civicrm.demoqueue" which may be easier to read than the others:https://github.com/civicrm/civicrm-core/tree/master/tools/extensions/org.civicrm.demoqueuehttps://github.com/civicrm/civicrm-core/tree/master/tools/extensions/org.civicrm.demoqueue/CRM/Demoqueue/Page
You've probably figured this out already, but the main concepts are:
* Task: A particular unit of work. (Note: The queue can store anything serializable, but if you want to use the QueueRunner, then the queue should store Task objects.)
* Queue: The stored list of tasks. This usually stored in a SQL table (CRM_Queue_Queue_Sql).
* QueueRunner: The worker which consumes the tasks iteratively, executing each. For CLI usage (like drush), one would call runAll() or runNext(). For the web UI, one would call $runner->runAllViaWeb(). runAllViaWeb is a terminal call - executing it will immediately trigger a redirect to the queue UI.
There's a little more documentation about the options accepted by QueueRunner in the docblocks:https://github.com/civicrm/civicrm-core/blob/master/CRM/Queue/Runner.php#L90