Re: async queries in Perl and poll()/select() loop - how to make them work together?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: async queries in Perl and poll()/select() loop - how to make them work together?
Дата
Msg-id AANLkTikT=EC+0whYXH_VG4iLna9BF22cYcn=gLbF2Eab@mail.gmail.com
обсуждение исходный текст
Ответ на Re: async queries in Perl and poll()/select() loop - how to make them work together?  (Andy Colson <andy@squeakycode.net>)
Список pgsql-general
On Mon, Nov 1, 2010 at 1:31 PM, Andy Colson <andy@squeakycode.net> wrote:
> I dont think you can start a second query until you have called
> $dbh->pg_result.  These constants just give you neat ways of waiting... its
> still just one at a time.

Correct.  The C api also supports the ability to test if getting the
result would 'block'...meaning wait for the server generated result
because the client doesn't have it yet.

Asynchronous queries give you a neat way to wait on the server or do a
bit of work while a previous query is executing without dealing with
the headache of threads.  You can't overlap queries on a single
connection because the server doesn't support it.  You could however
create (a very small number of, like 2) multiple connections, keep
them open, and round robin them.  Forking is overkill.

merlin

В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Replication
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: Replication