← Back to team overview

drizzle-discuss team mailing list archive

Re: libdrizzle: integration with another event loop


Eric Day wrote:
Ahh, yes. For some reason I was thinking of the old way I was handling
things, this has obviously been updated. In order to prevent thrashing
of set/unset of events, I make sure that the event set callback is
called everytime a FD is done being processed. If the active flags have
not changed, no call is required. If one is changed (ie, stop waiting
for POLLOUT), then the change can happen. Sorry for the confusion,
go along with the gearmand src example, as that is correct. :)

Okay, that seems to make sense. In tracing the code, libdrizzle will call event_watch_fn many times with the same set of bits. The extra "caching" done by the gearmand example should just be more efficient than repeatedly adding/removing fds in the event set.

The only extra complexity is that libdrizzle leaves the read event enabled when the connection is "idle." This means that if the connection breaks, I get a callback. How should I handle this "spurious" callback? Should I just assume this is a "connection closed" callback? Should I call some libdrizzle function? I suppose drizzle_con_ping would work ...


Evan Jones

Follow ups