laravel-swoole
laravel-swoole copied to clipboard
Add event swoole.beforeStart to be able to bind server events
Currently, there is no way to bind events on the server instance, as there is no way to retrieve it in a 'created, but not started yet' state. Therefore I added dispatching of swoole.beforeStart event.
Confirmed that this change creates errors. I am totally confused about the reason. I was able to find another way to reach my goal, but would really appreciate an explanation. In my case, this resulted the container being null in multiple places after this call (manager, concerns).
which places you've got null?
I was unable to reproduce. I'm almost sure that it was onRequest function (in manager): $this->app->make('events')->dispatch('swoole.request') line, the error was app being null. But you can find similar errors in the Travis CI log.
Ok, I'll run some tests here and try to understand it. I changed your PR to WIP in order to avoid other issues