swoole-src icon indicating copy to clipboard operation
swoole-src copied to clipboard

Using swoole with php frameworks

Open Spartaques opened this issue 2 years ago • 2 comments

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)

Spartaques avatar Jul 12 '21 11:07 Spartaques

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.

NathanFreeman avatar Jul 13 '21 12:07 NathanFreeman

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

embluk avatar Jul 13 '21 14:07 embluk