Swoole-src: Add "How does it work" section to Documentation

Created on 12 Nov 2017  ·  1Comment  ·  Source: swoole/swoole-src

Please consider adding a "How does it work" section in the Documentation.

At the moment, Swoole is a black box to me. One of my major reservations/objections, before even trying it, was along the lines of, "but PHP is single-threaded! this will never work for real-world applications."

By now, I understand that my swoole_http_server instance is actually somehow maintaining and running multiple instances of itself internally - I discovered this by adding echo spl_object_hash($instance) lines, for example, for the bootstrapping of my database connection in my DI container, and I see this echo-statements printing out 4 times, equal to the number of CPU cores.

How this is possible is black magic to me.

I think a lot of people may have reservations about the whole idea, because they don't understand it - as well as others who persist in actually trying it out, and would merely like to understand how it actually works.

A section on how it works might help eliminate confusion, drive adoption, and promote this extension.

Most helpful comment

@mindplay-dk Thanks for the suggestion, really appreciate.

Swoole is quite different from the traditional PHP model, it forks multiple worker processes based on CPU core number of the machine.

We have the plan to add more 'how it works' documents asap, will let you know when this is finished. :-)

>All comments

@mindplay-dk Thanks for the suggestion, really appreciate.

Swoole is quite different from the traditional PHP model, it forks multiple worker processes based on CPU core number of the machine.

We have the plan to add more 'how it works' documents asap, will let you know when this is finished. :-)

Was this page helpful?
0 / 5 - 0 ratings