← Back to team overview

drizzle-discuss team mailing list archive

Re: libdrizzle: integration with another event loop

 

Hi Evan,

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).

Glad to see someone is already using this interface, let me know if
you have any further questions!

-Eric

On Sun, Nov 15, 2009 at 07:33:11PM -0500, Evan Jones wrote:
> Evan Jones wrote:
> >This is perfect, although I don't get what I'm supposed to do to
> >*act* on the callback. For example, what if writing the query
> >blocks, how do I resume the write? Looking at examples/client.c,
> >it appears to keep calling drizzle_query() until it returns
> >DRIZZLE_RETURN_OK? This doesn't seem right to me when I follow the
> >code. It seems like this will cause the query to be issued
> >multiple times?
> 
> I apologize for all the emails. I finally figured it out. The answer
> is: yes, call the drizzle API function that returned IOWAIT until it
> returns OK.
> 
> I'm working on an example that can be included with libdrizzle. This
> will definitely integrate fairly cleanly with my application. I just
> need to write a wrapper to make libdrizzle's API work with my
> application's callback mechanism, which will be a little bit of
> work, but won't be too painful.
> 
> Still: definitely less work than wrapping libmysqlclient. Thanks,
> 
> Evan
> 
> -- 
> Evan Jones
> http://evanjones.ca/
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to     : drizzle-discuss@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help   : https://help.launchpad.net/ListHelp



Follow ups

References