0
0
Laravelframework~10 mins

Queue workers 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 Laravel queue worker.

Laravel
php artisan queue:[1]
Drag options to blanks, or click blank then click option'
Awork
Blisten
Cstart
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' instead of 'work' which does not start a queue worker.
Using 'listen' which listens for jobs but is less efficient than 'work'.
2fill in blank
medium

Complete the code to specify the queue connection when running a worker.

Laravel
php artisan queue:listen --[1]=redis
Drag options to blanks, or click blank then click option'
Aqueue
Bchannel
Cconnection
Ddriver
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--queue' which specifies the queue name, not the connection.
Using '--driver' which is not a valid option here.
3fill in blank
hard

Fix the error in the command to run a queue worker with a delay of 5 seconds.

Laravel
php artisan queue:work --delay=[1]
Drag options to blanks, or click blank then click option'
A5
B5s
Cfive
D0.5
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'five' which is not a number.
Using '5s' which includes units and causes an error.
4fill in blank
hard

Fill both blanks to run a queue worker on the 'emails' queue with 3 tries.

Laravel
php artisan queue:work --queue=[1] --tries=[2]
Drag options to blanks, or click blank then click option'
Aemails
Bnotifications
C3
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong queue name like 'notifications'.
Setting tries to 5 instead of 3.
5fill in blank
hard

Fill all three blanks to run a queue worker on the 'default' queue, with 10 seconds delay and 2 tries.

Laravel
php artisan queue:work --queue=[1] --delay=[2] --tries=[3]
Drag options to blanks, or click blank then click option'
Adefault
B10
C2
Durgent
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'urgent' as queue name which is incorrect here.
Using delay or tries values other than 10 or 2.