<p>Craft 3 now uses a job queue powered by the <a href="https://github.com/yiisoft/yii2-queue" rel="nofollow noreferrer">Yii2 Queue Extension</a>.</p>

<p>Some info in <a href="https://docs.craftcms.com/v3/updating-plugins.html#background-tasks" rel="nofollow noreferrer">Craft 3 Docs</a></p>

CC BY-SA 4.0
2018-05-21T10:23:50.267Z
2018-05-21T10:23:50.267Z
sanscheese
<p>Not so much true queues, but Craft does have the (completely undocumented) concept of Tasks, which are meant to be used for potentially long running tasks that don't need to execute immediately.  Plugins can create and register tasks to run.</p>

<p>Here are some questions discussing them:</p>

<p><a href="https://craftcms.stackexchange.com/questions/1394/my-tasks-dont-seem-to-be-running-as-a-background-process">My tasks don&#39;t seem to be running as a background process</a></p>

<p><a href="https://craftcms.stackexchange.com/questions/497/how-to-add-a-subtask-to-an-already-running-task">How to add a subTask to an already running Task?</a></p>

<p><a href="https://craftcms.stackexchange.com/questions/1359/triggering-the-start-of-a-task-from-a-cron-job">Triggering the start of a task from a CRON job</a></p>

<p>You can view the TaskService in <code>craft/app/services/TaskService.php</code> and you can see examples of Craft's own tasks in <code>craft/app/tasks</code>.</p>

<p>Also worth noting that proper support for queues at the framework level looks like it's on the <a href="https://github.com/yiisoft/yii2/pull/2378" rel="nofollow">roadmap for Yii 2.1</a>.</p>

CC BY-SA 3.0
2014-08-19T17:30:44.767Z
Awesome Brad. Thanks a lot for your help with all my plugin dev questions.
Justin Kimbrell
CC BY-SA 3.0
2014-08-20T14:14:26.230Z
Are the tasks executed at browser reload by the user or how is the integration done server-side? (How much can the tasks "handle" before a custom CRON-setup would be more ideal?)
naboovalley
CC BY-SA 3.0
2014-08-20T15:49:45.310Z
@naboovalley Currently executed by the next CP request, but you could easily write a plugin exposes a controller action that a CRON job could trigger.
Brad Bell
CC BY-SA 3.0
2014-08-19T17:14:10.967Z
2014-08-19T17:32:43.730Z
2014-08-19T17:32:43.730Z
Brad Bell
<p>I am wondering if Craft/Yii has some sort of built in queuing system for apps that need to do additional processing that could hang up the UI or make the user wait unnecessarily. I am looking for something similar to Laravel Queues. Does Craft have something similar built in? If not, I think queues would make a great addition to the API.</p>

<p><a href="http://laravel.com/docs/queues" rel="nofollow">http://laravel.com/docs/queues</a></p>

<plugin-development>
Does Craft have a server-side queuing system?
# Does Craft have a server-side queuing system?

(Asked by: username_0 on 2014-08-19)

I am wondering if Craft/Yii has some sort of built in queuing system for apps that need to do additional processing that could hang up the UI or make the user wait unnecessarily. I am looking for something similar to Laravel Queues. Does Craft have something similar built in? If not, I think queues would make a great addition to the API.

<http://laravel.com/docs/queues>

**Tags:** plugin-development


---

## 2 answers

### Answer by username_2 on 2014-08-19. Score: 4 | Accepted answer

Not so much true queues, but Craft does have the (completely undocumented) concept of Tasks, which are meant to be used for potentially long running tasks that don't need to execute immediately. Plugins can create and register tasks to run.

Here are some questions discussing them:

[My tasks don't seem to be running as a background process](https://craftcms.stackexchange.com/questions/1394/my-tasks-dont-seem-to-be-running-as-a-background-process)

[How to add a subTask to an already running Task?](https://craftcms.stackexchange.com/questions/497/how-to-add-a-subtask-to-an-already-running-task)

[Triggering the start of a task from a CRON job](https://craftcms.stackexchange.com/questions/1359/triggering-the-start-of-a-task-from-a-cron-job)

You can view the TaskService in `craft/app/services/TaskService.php` and you can see examples of Craft's own tasks in `craft/app/tasks`.

Also worth noting that proper support for queues at the framework level looks like it's on the [roadmap for Yii 2.1](https://github.com/yiisoft/yii2/pull/2378).

> **Comments:**
> **username_0**: Awesome Brad. Thanks a lot for your help with all my plugin dev questions.  
> **username_3**: Are the tasks executed at browser reload by the user or how is the integration done server-side? (How much can the tasks "handle" before a custom CRON-setup would be more ideal?)  
> **username_2**: @username_3 Currently executed by the next CP request, but you could easily write a plugin exposes a controller action that a CRON job could trigger.  

---

### Answer by username_1 on 2018-05-21. Score: 2

Craft 3 now uses a job queue powered by the [Yii2 Queue Extension](https://github.com/yiisoft/yii2-queue).

Some info in [Craft 3 Docs](https://docs.craftcms.com/v3/updating-plugins.html#background-tasks)


---

