-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
[Octane] Event use handle instead of asListener #136
Comments
Hi there 👋 Thanks for raising this! The issue with #87 was that Laravel Actions was not able to recognise the action as being a listener due to a lack of recognised frames. Since I've not used Octane yet, would you be able to tell me how Laravel dispatches listeners when used with Octane? It could be using a different method or perhaps even a different class than the ones listed above which would cause Laravel Actions to default to returning an object. |
This is a trace of the exception.
Note: |
According to your stacktrace, Laravel Actions should recognise it as a Listener (see code below).
Is there anything unusual about how you dispatch these events? |
I made some tests and I think that this part laravel-actions/src/ActionServiceProvider.php Lines 41 to 51 in 6e0aa6e
extends only some classes, maybe octane create a new application instance like there Edit: I added an |
Hey 👋 Sorry for the late reply. I finally got around to checking it out. Could you try to use |
Hi, thank you for your fix, but it doesn't work. I have the same exception:
I also made some tests but I'm worried that RequestReceived::class => [
...Octane::prepareApplicationForNextOperation(),
...Octane::prepareApplicationForNextRequest(),
//
], |
No worries, thanks for trying! If anyone using Octane would like to open a PR for this, that would be most appreciated. ❤️ |
Maybe @nunomaduro can give us a hit if nowadays Octane support |
Are you able to make a pull request in Octane with a failing test? Or create an issue, with a repository example, so I can reproduce the issue locally? |
This comment was marked as duplicate.
This comment was marked as duplicate.
@exodusanto I think he meant that you should create an issue in the Octane repo itself. |
Not yet 😔, I'll find some time next weeks |
* Fix #136 Octane Event use handle instead of asListener * Create the ActionManager as a scoped singleton instance
* Fix lorisleiva#136 Octane Event use handle instead of asListener * Create the ActionManager as a scoped singleton instance
Using Laravel Octane seems that actions are run as object instead of listener.
The problem is similar to #87, the workaround on EventServiceProvider event/listener registration works.
UserUpdated::class => NotifyUserUpdated::class.'@asListener'
The text was updated successfully, but these errors were encountered: