-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[5.5] add allOnQueue and allOnConnection for job chaining #21765
Conversation
@@ -96,6 +138,10 @@ public function dispatchNextJobInChain() | |||
if (! empty($this->chained)) { | |||
dispatch(tap(unserialize(array_shift($this->chained)), function ($next) { | |||
$next->chained = $this->chained; | |||
$next->chainConnection = $this->chainConnection; |
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.
This does not support having the chain connection change with the next job having the queue/connection already set...
$next->chainConnection = $next->chainConnection??$this->chainConnection;
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.
Yeah we don't want to do that, the chain connection is declared once and used as a default connection for when no connection is specified.
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.
Interesting. I am not sure why that was not communicated on my pull request. Keeps it simpler, Thanks.
#21568 (comment) |
@Artistan because in your PR you've changed the method signature. |
So you call these methods after |
@taylorotwell yes, the methods exist in PendingDispatch |
Ah OK I see. |
Having:
first
queue and onconnection1
.second
queue and onconnection2
.first
queue and onconnection1
.The new
allOnQueue
andallOnConnection
methods will instruct the dispatcher to use the given queue/connection if no queue/connection was set explicitly on each job.The old behaviour remains the same thus this PR is not a breaking change.