The exact way a task is executed depends on the used driver. Most drivers can be run using
console commands, which the component automatically registers in your application.

This command obtains and executes tasks in a loop until the queue is empty:

yii queue/run

This command launches a daemon which infinitely queries the queue:

yii queue/listen

See the documentation for more details about driver specific console commands and their options.

The component also has the ability to track the status of a job which was pushed into queue.

// Push a job into the queue and get a message ID.$id=Yii::$app->queue->push(newSomeJob());// Check whether the job is waiting for execution.Yii::$app->queue->isWaiting($id);// Check whether a worker got the job from the queue and executes it.Yii::$app->queue->isReserved($id);// Check whether a worker has executed the job.Yii::$app->queue->isDone($id);