swooletw / laravel-swoole

High performance HTTP server based on Swoole. Speed up your Laravel or Lumen applications.
MIT License
4.04k stars 390 forks source link

Question about Facade #484

Closed AkioSarkiz closed 3 years ago

AkioSarkiz commented 3 years ago
  1. PHP 8, swoole 4.6.6
  2. Laravel 8
  3. 2.8.1
  4. It's not error.
  5. -
  6. -
  7. I have a question. When Websocket facade is available? When I tested this package, have error when I send a message from the "tinker". But, when I send a message from the route, this error not showed. I don't found the answer, when Facade Websoket is initialized.

Error message from tinker:

 Target class [swoole.websocket] does not exist.
Arkanius commented 3 years ago

The main difference is: when running swoole you "changed" your way to run php applications by running it in a console event loop way, this means, every request won't boot your framework again, it'll boot just once and will be reused by other requests. When running with tinker you're not passing by swoole (swolle http: start)