Find file
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (42 sloc) 1.8 KB

everl is an Erlang library for asynchronously generating socket notifications using libev. everl lets you watch file descriptors for events and sends your process a message whenever the socket state changes.


everl started out as a contribution to procket by Gregory Haskins ( but it was so awesome I decided to move it into its own repository. The original patch is here:

libev was written by Marc Alexander Lehmann and is available from:



create(FD, Flags) -> {ok, Handle} | {error, posix()}

    Types   FD = int()
            Flags = [Flag]
            Flag = read | write
            Handle = resource()

    Returns a handle for watching events on the file descriptor.

arm(Handle) -> ok

    Types   Handle = resource()

    Initiates notifications on the file descriptor. The watch handle
    must be re-armed after each notification is received.

    The process creating the handle will receive:

        {everl_watcher, FD, Event}


        FD is the file descriptor associated with the watch handle.

        Event is an integer:

            1 (READ): file descriptor is ready for reading
            2 (WRITE): file descriptor is ready for writing
            3 (RDWR): file descriptor is ready for reading and writing

disarm(Handle) -> ok

    Types   Handle = resource()

    Disable notifications for the file descriptor and close the
    watch handle.



make test


  • Documentation and examples

  • Support all of libev

  • API changes