请问ReactPHP的这一段介绍 是什么意思啊?

ReactPHP is non-blocking by default. Use workers for blocking I/O.

阅读 1.5k
1 个回答

没用过,简单看了一下,感觉像是 PHP 版的 Node.js,很多设计思路都是来自于 Node.js 的。

毕竟人家自己也说了:

The event loop is based on the reactor pattern (hence the name) and strongly inspired by libraries such as EventMachine (Ruby), Twisted (Python) and Node.js (V8).

大体就是用 PHP 实现了一套 JS 里的 EventLoop 机制,虽然是单线程的、但也是非阻塞式 I/O 的。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题