gotzmann / comet

Modern PHP framework for building blazing fast REST APIs and microservices
MIT License
660 stars 52 forks source link

[Question]Is there any difference in usage between comet and the original SlimPHP? #6

Closed peinhu closed 4 years ago

peinhu commented 4 years ago

Hello, thanks for your efforts on "Make PHP Great Again", there are a few questions I want to figure out.

I've used SlimPHP and workerman before, now I'm wondering is there any singleton issue or other issue in comet? Is there any difference in usage between comet and the original SlimPHP? Any notice we should know when using comet?

gotzmann commented 4 years ago

Hello, great question, sorry for so long delay with answer.

In Comet, the singleton instances will work the same way as with Swoole-based Laravel.

Moreover, each worker in Comet has it's own spaces of global variables and class, so there the same problems as in PHP at whole if you should share some data between requests.

At the moment, I thinking about some fast, easy-to-use and simple way to share data or communicate between workers. Typical solutions are: databases, Redis / memory cashes and shared files.

peinhu commented 4 years ago

Got it, thank you.