Should dispatchAfterResponse respect the ShouldBeUnique interface? #40502
Unanswered
redelschaap
asked this question in
Ideas
Replies: 1 comment
-
Also ran into this, it should respect the ShouldBeUnique interface! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In a recent project, I needed to dispatch a job after the application would be terminated and I used the
dispatchAfterResponse
method. Since the dispatching was happening in an observer, the job could be dispatched multiple times. Since I was dealing with the exact same job, I needed it to be only dispatches once after the application would terminate.To fix this, I used the
ShouldBeUnique
interface on my job, expecting it to be dispatched only once. But it didn't, because that function calls thedispatchNow
method internally, which doesn't check on this interface.So right now, the
dispatchAfterResponse
method does not respect theShouldBeUnique
interface. Should it? As a developer, I would expect it to do.If this sounds logical, I can work on the
dispatchAfterResponse
method to respect theShouldBeUnique
interface.If this is intended behavior, would a
dispatchOnceAfterResponse
method be something I can propose for the framework?Beta Was this translation helpful? Give feedback.
All reactions