[getdns-users] getdns_context_run() vs. getdns_context_process_async()

Hollenbeck, Scott shollenbeck at verisign.com
Fri May 1 00:29:08 UTC 2015


> -----Original Message-----
> From: Users [mailto:users-bounces at getdnsapi.net] On Behalf Of Willem
> Toorop
> Sent: Thursday, April 30, 2015 5:13 PM
> To: users at getdnsapi.net
> Subject: Re: [getdns-users] getdns_context_run() vs.
> getdns_context_process_async()
> 
> Hi Scott,
> 
> I don't know for sure without seeing the code, but might it be that you
> destroy the context right after the call to
> getdns_context_process_async() ?

Yes, exactly. My code for this test case calls getdns_address(),getdns_context_process_async(), and then it destroys the context.

> getdns_context_process_async() just has a quick look if it can do some
> callbacks immediately.  If it cannot, it will not block and exit
> immediately.  When there are requests still in flight they will be
> cancelled on a subsequent call to getdns_context_destroy().
> 
> If you want to process all outstanding queries, you should use
> getdns_context_run().
> 
> Also getdns_context_process_async() does not work with stub requests
> with libevent.  The function is a leftover from earlier asynchronous
> mechanics and I would actually rather get rid of it.  Use
> getdns_context_run() instead.

OK, I'll update my documentation appropriately - thanks!

Scott




More information about the Users mailing list