generic wrapper for event libraries https://redmine.lighttpd.net/projects/evcon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.9 KiB

9 years ago
  1. Description
  2. -----------
  3. 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.
  4. Platforms
  5. ---------
  6. Should work on all POSIX compatible platforms.
  7. Features
  8. --------
  9. Event types:
  10. * read and write events for asynchronous file descriptors (sockets)
  11. * simple timeout events
  12. * (thread safe) asynchronous events (notifications - for example from other threads, that wakeup the event loop)
  13. Backends for:
  14. * [libev](http://software.schmorp.de/pkg/libev.html)
  15. * [libevent](http://libevent.org/)
  16. * [glib](http://developer.gnome.org/glib/unstable/glib-The-Main-Event-Loop.html)
  17. Simple Scenario
  18. ---------------
  19. 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.
  20. 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.
  21. Examples
  22. --------
  23. See `src/tests/evcon-echo.c` and `src/tests/evcon-echo.h` for an example "library", and `src/tests/evcon-test-*.c` for how to use them in an application.
  24. Building from git
  25. -----------------
  26. Run the following in the source directory to prepare the build system:
  27. ./autogen.sh
  28. You will need automake and autoconf for this.
  29. Building
  30. --------
  31. All backends need glib (>= 2.14).
  32. The libev backend needs libev >= 4, the libevent backend needs libevent >= 2.
  33. Build in a sub directory:
  34. mkdir build
  35. cd build
  36. ../configure
  37. make check
  38. Install (probably has to be run as root):
  39. make install
  40. As always it is recommended to use a package system to install files instead (dpkg, rpm, ...).