-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
priority queue #21
base: main
Are you sure you want to change the base?
priority queue #21
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Default Queue Connection Name | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Laravel's queue API supports an assortment of back-ends via a single | ||
| API, giving you convenient access to each back-end using the same | ||
| syntax for every one. Here you may define a default connection. | ||
| | ||
*/ | ||
|
||
'default' => env('QUEUE_CONNECTION', 'sync'), | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Queue Connections | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Here you may configure the connection information for each server that | ||
| is used by your application. A default configuration has been added | ||
| for each back-end shipped with Laravel. You are free to add more. | ||
| | ||
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" | ||
| | ||
*/ | ||
|
||
'connections' => [ | ||
'redis' => [ | ||
'driver' => 'redis', | ||
'connection' => 'default', | ||
'queue' => env('REDIS_QUEUE', 'default'), | ||
'retry_after' => 90, | ||
'block_for' => null, | ||
'after_commit' => false, | ||
], | ||
'redis_high' => [ | ||
'driver' => 'redis', | ||
'connection' => 'default', | ||
'queue' => 'high', | ||
'retry_after' => 90, | ||
'block_for' => null, | ||
'after_commit' => false, | ||
], | ||
'redis_low' => [ | ||
'driver' => 'redis', | ||
'connection' => 'default', | ||
'queue' => 'low', | ||
'retry_after' => 90, | ||
'block_for' => null, | ||
'after_commit' => false, | ||
], | ||
Comment on lines
+40
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although we're defining these new connections, no job is using them. The jobs have different queues associated, but since we're not declaring different connections, they're all being sent to the default connection ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have defined the low or high in some jobs: https://github.com/FogosPT/fogosapi/blob/feature/14-priority-queue/app/Observers/IncidentObserver.php#L23 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've noticed it, but the queue name is not the connection name, which was what we are defining here. We can have one connection that handles multiple queues. So, to put it simply: we should keep one Redis connection. |
||
], | ||
|
||
|
||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the default set as
sync
because of the scheduled jobs?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's the default, didn't change it. Should it be
redis_low
orredis_high
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just
redis
.