Skip to content
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

fix: callback handlers for queue workers #43

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

gavinservai
Copy link
Contributor

When using a queue worker, each notification resets the scope. The problem here is that when this happens, all of the callbacks that were registered are no longer available - this is because they were all registered to a scoped singleton. I'm not sure how anyone else is able to use this package with a queue worker - out of the box it only works on "sync" mode, unless we remove the scoped singleton.

In-fact, I'm curious as to why the singleton was scoped in the first place as part of the laravel 9 compatibility upgrades?

When using a queue worker, each notification resets the scope.
The problem here is that when this happens, all of the callbacks that were registered are no longer available - this is because they were all registered to a scoped singleton.
I'm not sure how anyone else is able to use this package with a queue worker - out of the box it only works on "sync" mode, unless we remove the scoped singleton.

In-fact, I'm curious as to why the singleton was scoped in the first place as part of the laravel 9 compatibility upgrades?
@gavinservai
Copy link
Contributor Author

Just following up on this

@phillipfickl
Copy link

Your pull request works for me - thanks for that!
I'm not sure though if it will get merged - looks like the package got abandoned..

@peterfox peterfox merged commit 23f0f21 into ylsideas:main Jan 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants