-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[11.x] Introduce throw() to PendingDispatch #52394
base: 11.x
Are you sure you want to change the base?
[11.x] Introduce throw() to PendingDispatch #52394
Conversation
Thanks for submitting a PR! Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
8f48575
to
4780bd1
Compare
For consistency with similar functionality in batches/chains, wouldn't |
I don't like the quite broad naming. Wouldn't it be better to have something like Another possible parameter (type) to this method could be a |
This pull request introduces an optional feature to throw an exception when attempting to dispatch a subsequent unique job that is already in the queue. This enhancement provides clear feedback to the job dispatcher, indicating that the current dispatch attempt has been ignored due to the presence of an existing unique job.
Details:
JobDispatchedException
if a unique job with the same identifier is already dispatched.throw()
behavior from the HTTP Client/Response and the Process Facade.Example Usage:
An exception is thrown if the job fails to meet the "unique" requirement.
The closure is executed immediately before the exception is thrown.
The existing behavior of ignoring subsequent dispatches of the same unique job is preserved.
Note:
I'm currently having trouble instantiating an instance of
Illuminate\Contracts\Cache\Repository
in the test - appreciate any pointers!