Search Postgresql Archives

Re: PQisBusy() always returns TRUE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martijn van Oosterhout writes:

On Sat, Jan 15, 2005 at 09:50:35PM +0200, ntinos@xxxxxxx 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




---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux