Re: PQisBusy() always returns TRUE - Mailing list pgsql-general

From ntinos@aueb.gr
Subject Re: PQisBusy() always returns TRUE
Date
Msg-id courier.41E98EB5.00005257@red.servers.aueb.gr
Whole thread Raw
In response to Re: PQisBusy() always returns TRUE  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: OID Usage
Next
From: Bruce Momjian
Date:
Subject: Re: OID Usage