k911 / swoole-bundle

Symfony Swoole Bundle
MIT License
260 stars 46 forks source link

Use cooperative scheduling in request handling by enabling swoole coroutine hooks for IO functions #561

Open Rastusik opened 3 years ago

Rastusik commented 3 years ago

Is your feature request related to a problem? Please describe. Current architecture of the swoole bundle expects the swoole http server process to handle exactly one request at once. I would like to enable cooperative scheduling by enabling the swoole IO functions coroutine hooks to be able to handle multiple requests concurrently, as the usage if Swoole was intended by design.

Describe the solution you'd like The bundle should have a configuration option (e.g. cooperative_scheduling) which would enable concurrent request processing. I'm currently doing research and figuring out how to do it, I've identified these pin points:

Describe alternatives you've considered I don't see any alternatives here, except the current implementation, feel free to discuss

Additional context Nope

Rastusik commented 2 years ago

@k911 I was finally able to get some time to create a working POC, what do you think about it? Btw. is this project still maintained?

k911 commented 2 years ago

@Rastusik looks good for me. Currently, I don't develop anything so we might say it's not maintained properly.