Project

General

Profile

Wiki » History » Revision 2

Revision 1 (stbuehler, 2012-11-05 16:04) → Revision 2/3 (stbuehler, 2012-11-05 16:09)

h2. Description 

 evon is a generic wrapper library that sits between libraries that need socket (file descriptor), timeout and (thread safe) asynchronous events, and an application that wants to use the library. 

 h2. Platforms 

 Should work on all POSIX compatible platforms. 

 h2. Features 

 Event types: 

 * read and write events for asynchronous file descriptors (sockets) 
 * simple timeout events 
 * (thread safe) asynchronous events (notifications - for example from other threads, that wakeup the event loop) 

 Backends for: 

 * "libev":http://software.schmorp.de/pkg/libev.html 
 * "libevent":http://libevent.org/ 
 * "glib":http://developer.gnome.org/glib/unstable/glib-The-Main-Event-Loop.html 


 h2. Simple Scenario 

 You want to write an application that uses two different event based libraries; if these libraries don't use the same event loop (say X uses libev and Y libevent) you will have difficulties using them - you could give each library its own thread for example, but embedding one event loop in another is usually not easy. 

 If the libraries were built against evcon, you could use any event loop - if there is no backend for it yet, you probably can write one. 

 h2. Examples 

 See source:src/tests/evcon-echo.c and source:src/tests/evcon-echo.h for an example "library", and source:src/tests/ @evcon-test-*.c@ for how to use them in an application. 

 h2. Sources 

 * @git clone git://git.lighttpd.net/evcon.git@ (official) 
 * @git clone git://github.com/lighttpd/evcon.git@ (for pull requests) 
 * http://download.lighttpd.net/evcon/ (released versions) 

 Browse the sources: 
 * http://git.lighttpd.net/evcon.git/ 
 * https://github.com/lighttpd/evcon 

 h2. Building from git 

 Run the following in the source directory to prepare the build system: 

 <pre> 
 ./autogen.sh 
 </pre> 

 You will need automake and autoconf for this. 

 h2. Building 

 All backends need glib (>= 2.14). 
 The libev backend needs libev >= 4, the libevent backend needs libevent >= 2. 

 Build in a sub directory: 

 <pre> 
 mkdir build 
 cd build 
 ../configure 
 make check 
 </pre> 

 Install (probably has to be run as root): 

 <pre> 
 make install 
 </pre> 

 As always it is recommended to use a package system to install files instead (dpkg, rpm, ...).