Hacker News new | ask | show | jobs
by francislavoie 2025 days ago
Pretty great with https://github.com/ratchetphp/Ratchet tbh. But yeah, different runtime. Ratchet is built on top of ReactPHP which is an event-loop runtime (think nodejs).

It's helpful to be able to reuse some domain code between the two if necessary, but IO cannot be done the same in ReactPHP because it needs to be async. Good news is ReactPHP has a ton of really great async libs (mysql, redis, etc.) https://reactphp.org/

As others have said, Swoole is also an option, it's more like Go (coroutine style). Personally, I think it's super cool, but not something I want to use, because the majority of the userbase is chinese and the docs and ecosystem suffer from the language barrier.

1 comments

fyi on swoole, this book [1] just came out (I cannot comment on the quality, haven't read yet) which hopefully will help bridge the English documentation gap. I've been using swoole for a couple of years and google-translating my way through the Chinese wiki and git issues/comments/etc.

[1] https://www.amazon.com/dp/B0881B227S