Replies: 5 comments
|
Confirmed. The debounce wiring lives in The owner token and the delay are set in dispatch(new ProcessThing('x')); // debounced
Bus::dispatch(new ProcessThing('x')); // not debounced, runs right away
I don't know if anyone else has tried this and confirmed it. |
|
@scabarcas17 yeah i confirmed it, it happens with queued Job listeners as well |
|
This also applies to other things like |
|
Hmm I disagree. Debouncing is basically an attribute of the job, which should be honoured however the job is being dispatched. That should be true for all attributes IMO. Besides, people preferring dependency injection shouldn't be forced to use facades to get the expected behaviour (which is basically the case here). I understand that a path allowing for pushing a job onto a queue while bypassing its attributes might be desirable, but it should be an explicit one IMO (e.g. |
|
I keep getting bitten by this. I really think this is a problem. |
Uh oh!
There was an error while loading. Please reload this page.
Laravel Version
13.12.0
PHP Version
8.4
Database Driver & Version
No response
Description
While testing debounced jobs, I noticed that they seemed to be processed immediately when dispatched through
Illuminate\Bus\Dispatcher, and correctly delayed when using theDispatchable::dispatchmethod.Taking a closer look, I can see that the latter returns an instance of
PendingDispatch(and so does thedispatch()helper), but the former doesn't. This isn't documented as far as I can tell, and I would expectIlluminate\Bus\Dispatcher::dispatchto behave in a similar way.Steps To Reproduce
Dispatch a job using either method and observe the difference.
All reactions