szopen
V2EX  ›  PHP

PHP 的在 Linux 平台下异步新玩具 PHP epoll

  •  
  •   szopen · Oct 9, 2019 · 4353 views
    This topic created in 2435 days ago, the information mentioned may be changed or developed.

    通过 FFI 将 linux 的 epoll 函数封装了一下,可以用来写写异步的东西

    https://github.com/chopins/php-epoll

    项目提供了 linux 的三个异步函数,以及将 PHP 资源转换成文件描述符的方法(文件描述符见 https://www.php.net/manual/en/wrappers.php.php#wrappers.php.fd )。

    资源转文件描述符目前只支持文件(比如fopen)、网络(比如stream_socket_server)、STDIN。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5104 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 03:55 · PVG 11:55 · LAX 20:55 · JFK 23:55
    ♥ Do have faith in what you're doing.