swoole / swoole-src

🚀 Coroutine-based concurrency library for PHP
https://www.swoole.com
Apache License 2.0
18.47k stars 3.16k forks source link

Using swoole with php frameworks #4314

Open Spartaques opened 3 years ago

Spartaques commented 3 years ago

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a simple script for reproducing the error.

I'm using laravel framework for backend development. I'm also using here package that support swoole https://github.com/laravel/octane/

  1. What did you expect to see?

I expect to use coorutines and async io.

  1. What did you see instead?

I see that framework works without async io and coorutines. I haven't any explanation about disabling this features. So i'm interesting to understand can i use this features with laravel framework, or maybe i should implement the posibility myself.

  1. What version of Swoole are you using (show your php --ri swoole)?

4.6.7

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

Linux fb7acba0e6e0 5.10.25-linuxkit #1 SMP Tue Mar 23 09:27:39 UTC 2021 x86_64 GNU/Linux , PHP 8.0.8 , gcc version 8.3.0 (Debian 8.3.0-6)

NathanFreeman commented 3 years ago

Hi,It is very diffuclt to use this features with laravel framework because of laravel framework has many static attributes and singleton.

The data between different requests will affect each other. It is unsafe.

embluk commented 3 years ago

Checkout the awesome Swoole list, it may have other frameworks or tools that suit what you are looking for: https://www.swoole.co.uk/awesome-swoole#frameworks