[getdns-api] PHP Language Bindings and Async Event Management
Hollenbeck, Scott
shollenbeck at verisign.com
Mon Apr 20 13:55:24 CEST 2015
> -----Original Message-----
> From: getdns-api [mailto:getdns-api-bounces at vpnc.org] On Behalf Of
> Melinda Shore
> Sent: Friday, April 17, 2015 3:05 PM
> To: getdns-api at vpnc.org
> Subject: Re: [getdns-api] PHP Language Bindings and Async Event
> Management
>
> On 4/17/15 10:27 AM, Hollenbeck, Scott wrote:
> > So, what's the best way to approach the event management operations
> > needed for asynchronous processing?
>
> I won't claim it's "best" (I'd like to see non-blocking callback
> processing, as well) but what I did in the Python bindings was
> to bind the event base to the context, and when the user issues
> a query I create a new event base only if there isn't one already.
> This allows <bignum> queries to be issued asynchronously against
> a given context. There's also a Context.run() method, which runs the
> event loop (and is blocking), and it's called at the user's pleasure.
> The run() method is the only place where the event loop is run.
Thanks for the tip, Melinda. If I understand correctly, this implies that you should have some code to free the event base when the context is destroyed, correct? If not, where are you freeing the event base?
Scott
_______________________________________________
getdns-api mailing list
getdns-api at vpnc.org
More information about the spec
mailing list