The libevent API provides a mechanism to execute a callback function when a specific event occurs on a file descriptor or after a timeout has been reached.
Libevent is a software library that provides asynchronous event notification. Libevent also supports callbacks triggered by signals and regular timeouts. Libevent is meant to replace the event loop found in event-driven network servers.