API in ATS for libev

44 views
Skip to first unread message

gmhwxi

unread,
May 15, 2014, 11:05:57 AM5/15/14
to ats-lan...@googlegroups.com
Before handling libuv, I took a detour to build an API for using libev in ATS:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/libats-/hwxi/libev

As far as interface design is of the concern, libev seems to be far superior to libevent
in my opinion. If something can be done both in libev and in libevent, then I would, for now,
prefer to do it in libev.

Cheers!

PS: There is an example test00-pkgreloc.dats in the TEST directory; this example
shows how to use the API for libev without pre-installing it. The following lines tell
atspkgreloc where the API for libev can be located:

//
#define
PATSCONTRIB
"\
https://raw.githubusercontent.com/\
githwxi/ATS-Postiats-contrib/master/contrib"

//
require "{$PATSCONTRIB}/libats-/hwxi/libev/SATS/ev.sats"
require "{$PATSCONTRIB}/libats-/hwxi/libev/DATS/ev.dats"
require "{$PATSCONTRIB}/libats-/hwxi/libev/CATS/ev.cats"
//

If you execute 'make test00-pkgreloc.wget', then the libev package will be downloaded.

Then you can do 'make test00-pkgreloc' to compile the example.


Chris Double

unread,
May 15, 2014, 10:30:48 PM5/15/14
to ats-lan...@googlegroups.com
On Fri, May 16, 2014 at 3:05 AM, gmhwxi <gmh...@gmail.com> wrote:
> If something can be done both in libev and in libevent, then
> I would, for now, prefer to do it in libev.

I use libevent for their http interface which libev unfortunately
doesn't have. For direct event handling I mostly use epoll directly
now:

https://ezcrypt.it/rZ5n#MhHrh9mRydNuomSwXhP8XS6N

--
http://www.bluishcoder.co.nz
Reply all
Reply to author
Forward
0 new messages