0
0
Laravelframework~10 mins

Queue worker supervision in Laravel - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start a queue worker that listens to the default queue.

Laravel
php artisan queue:[1]
Drag options to blanks, or click blank then click option'
Astart
Blisten
Cwork
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'listen' instead of 'work' which is a different command.
Using 'start' or 'run' which are not valid artisan queue commands.
2fill in blank
medium

Complete the code to run a queue worker that processes jobs on the 'emails' queue.

Laravel
php artisan queue:work --queue=[1]
Drag options to blanks, or click blank then click option'
Anotifications
Bjobs
Cdefault
Demails
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong queue name like 'notifications' or 'default'.
Omitting the queue name which defaults to 'default'.
3fill in blank
hard

Fix the error in the supervisor configuration to set the correct command for the queue worker.

Laravel
"command": "php artisan queue:[1] --sleep=3 --tries=3"
Drag options to blanks, or click blank then click option'
Awork
Bstart
Crun
Dlisten
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'listen' instead of 'work' in supervisor config.
Using invalid commands like 'start' or 'run'.
4fill in blank
hard

Fill both blanks to configure supervisor to restart the queue worker every 3600 seconds and log output to the correct file.

Laravel
"command": "php artisan queue:[1] --sleep=3 --tries=3 --timeout=90",
"autorestart": true,
"startretries": 3,
"stopwaitsecs": 3600,
"stdout_logfile": "/var/log/laravel/[2].log"
Drag options to blanks, or click blank then click option'
Awork
Blisten
Cworker
Dqueue
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'listen' instead of 'work' in the command.
Naming the log file incorrectly or inconsistently.
5fill in blank
hard

Fill all three blanks to create a Laravel command that supervises queue workers with a max of 5 processes and a timeout of 120 seconds.

Laravel
supervisor_config = {
  "command": "php artisan queue:[1] --sleep=3 --tries=3 --timeout=[2]",
  "numprocs": [3],
  "autorestart": true
}
Drag options to blanks, or click blank then click option'
Alisten
Bwork
C120
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'listen' instead of 'work' for the command.
Setting timeout or numprocs to wrong values.