New PHP extension under the old name: event

    In PELC, they somehow stopped supporting extensions for libevent . In particular, libevent version 2 was not supported by the libevent extension of the same name or the event extension (the last release was in 2004). Therefore, it was decided to rewrite the “event” extension, which had been lying around since 2004.

    Thus, event is an old extension in a new guise:

    • support for libevent 2.0.2-alpha and higher, including HTTP server, Event Listener , DNS resolver and OpenSSL, as well as some functions of buffers and “buffer events” that were not available in previous versions
    • new object oriented API
    • the ability to configure the necessary components (libevent_core, libevent_extra, libevent_pthreads, libevent_openssl) during installation


    The transition to the OO API is due to the fact that the original function names in libevent do not differ in particular beauty:

    bufferevent_setcb
    bufferevent_setwatermark
    bufferevent_socket_get_dns_error
    evbuffer_add_buffer
    evbuffer_get_contiguous_space
    

    etc.

    In addition, a member of the core PHP team, Johannes Schlüter assured that resources almost do not benefit in performance compared to objects, and sometimes even lose. In general, recently there has been a tendency towards a transition to objects.

    Documentation

    http://docs.php.net/manual/en/intro.event.php . Examples are also in the Examples section.

    Installation

    $ sudo pecl install event-beta
    $ sudo pecl install event

    The extension is being actively tested on Gentoo, Fedora, Ubuntu, and FreeBSD. While from time to time there is a need for corrections and additions, the code is in beta version.

    I hope this will be useful to someone.

    Thanks.

    UPDATE

    Stable release 1.5.0 is available.

    PS

    Used in the phpDaemon project .

    Also popular now: