Closed evsign closed 3 years ago
Also maybe it's related to https://github.com/swooletw/laravel-swoole/issues/395
Hi there,
swoole "rebinds" the app container instance at each request. The app is a default rebinding. You can see other cleanings, resets and rebinds at config file.
Worker is not asynchronous?
Yes, but each request has his own container binded
Could you please explain how laravel helper
app(...)
would work? In doc and in some issues i've seen how has been said that using facades is safe and each request will be bound to the separate container instance, but i don't understand how it will work safely withapp(...)
function.Currently laravel
app(...)
function looks like this:and
Containe::getInstance()
:As i see he stores himself in global static property which could be overwritten if some of request start concurrency io work. Swoole will pause one coroutine and start another where new request can come and container instance will be reseted.