← Back to team overview

drizzle-discuss team mailing list archive

Re: libdrizzle: integration with another event loop

 

Eric Day wrote:
Sorry for the lack of responses this weekend, but it looks like you
figured things out. :)  Yes, libdrizzle was designed to do just what
you want: non-blocking I/O for single thread use with the ability for
external event mechanisms (like libevent). Setting the appropriate
notification callbacks and setting the revents from poll() allows
you to create your own drizzle_con_wait() replacement (the libevent
callbacks should just do what that function does).

A few questions:

Am I supposed to call drizzle_con_revents()? The documentation suggests that I should. However, I'm following examples/client.c which just calls the API calls that returned IO_WAIT again. That seems to be working for me at the moment.

When I get a call to my event_watch_fn, I'm assuming the event watches should be "persistent." That is, I should continue to watch the fd for those events, until I get another call to my event_watch_fn with the bit set to zero?

I've been pushing some small changes to my libdrizzle branch. You probably don't want to apply any of these directly, but I think these are are legitimate fixes (with a little clean up, maybe):

https://code.launchpad.net/~evanj/libdrizzle/external-event-loop

123 - fix a make check-valgrind warning
124 - fix examples to match documentation
125 - expand the documentation for event_watch_fn
126 - tests for event_watch_fn and missing calls to set_events (i think)
127; 128 - context should be void* not const void* for use in C++
129 - make check-valgrind fix should have been included in r123

Thanks,

Evan

--
Evan Jones
http://evanjones.ca/



Follow ups

References