Martijn van Oosterhout writes:
> On Sat, Jan 15, 2005 at 09:50:35PM +0200, ntinos@aueb.gr wrote:
>> PQconsumeInput(conn); //Try to collect the results
>> while (PQisBusy(conn)) // while not ready ...
>> PQconsumeInput(conn); //...retry
>>
>> res=PQgetResult(conn); // Now get the results
>>
> I belive if you're waiting in an event loop, you can use PQsocket() to
> return the fd to use in select. Or if you're doing other work, do that
> while you're waiting and check isBusy when you have time...
Well, I do use select() before calling PQconsumeInput, but I'm not sure what
an event loop would be like.I have more than one (remotly executed) queries
and I want to pick whatever results are available without being blocked (and
even abord a delaying query), i.e. I do have other work to do. Having said
that, I think that an event loop would be appropriate but I'm a little
confused on its structure. Any pointers?
Thanks,
Ntinos Katsaros