Laravel-swoole: Can we use Facades or not?

Created on 22 May 2018  路  3Comments  路  Source: swooletw/laravel-swoole

Please clarify in the Facades page of the wiki whether or not the basic Facades shipped by Laravel are okay to use or not.

I know that statics that are expected to yield different results in different requests should be avoided when developing under Swoole, because all requests happen under a single CLI call.
What is not clear to me though is whether standard Laravel Facades also count as statics to be avoided, or if they are already written cleverly enough that in such multithreaded event loop contexts they are safe to use.

question

Most helpful comment

Hi @amcsi ,

Yes, you can use Facades safely with this package. The app container will be automatically bound to a clean sandbox container in each request. Without the consideration for async client or coroutine, it's safe to use facades.

All 3 comments

Hi @amcsi ,

Yes, you can use Facades safely with this package. The app container will be automatically bound to a clean sandbox container in each request. Without the consideration for async client or coroutine, it's safe to use facades.

Thank you, that's great news!

Hi @amcsi ,

Anytime :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MikeMaldini picture MikeMaldini  路  10Comments

omsun123 picture omsun123  路  6Comments

storyn26383 picture storyn26383  路  5Comments

Abbotton picture Abbotton  路  9Comments

jiangjiang0228 picture jiangjiang0228  路  8Comments