[9.x] Adds closure support to dispatch conditionals.#43784
Merged
taylorotwell merged 3 commits intolaravel:9.xfrom Aug 22, 2022
DarkGhostHunter:feat/dispatch-condition-callable
Merged
[9.x] Adds closure support to dispatch conditionals.#43784taylorotwell merged 3 commits intolaravel:9.xfrom DarkGhostHunter:feat/dispatch-condition-callable
taylorotwell merged 3 commits intolaravel:9.xfrom
DarkGhostHunter:feat/dispatch-condition-callable
Conversation
Member
|
IMO the entire job instance should be passed to the closure. I have updated the PR. Thoughts? |
Contributor
Author
|
I don't have too much of maneuverability if I get the job instance full of non-public members, so it would force me to: a) make a public method for additional checks. Since these are small chores, I can see it can be more convenient and forces me to push part of the check in the instance itself. I approve these changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Enables usage of closures to dispatch a job conditionally. The closure will receive the job arguments.
Also adds tests both
dispatchIfanddispatchUnless.