Re: Is there any way to listen to NOTIFY in php without polling?

Поиск
Список
Период
Сортировка
От Clemens Eisserer
Тема Re: Is there any way to listen to NOTIFY in php without polling?
Дата
Msg-id CAFvQSYRDTXn2WQ-UGcF-1c1hptR9-pSo1hq_-+bm8bJbN5THqQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is there any way to listen to NOTIFY in php without polling?  (Misa Simic <misa.simic@gmail.com>)
Список pgsql-general
Hi Misa

> But Example shows - that C app - actually asks all the time to get notify...
> when gets something more then 4 times - exit... until 4 times loops...
> The same you can achieve with PHP...

As far as I understood, with php I have to query the server again and
again, and pg_get_notify will either return something or not depending
on the query result:
http://php.net/manual/en/function.pg-get-notify.php

The provided sample however blocks until a notify is received (and
does so 4 times just for demonstration puporse), so instead of
frequently asking the server for notifications (polling), it wakes up
when a notification arrives.

> My guess is that main goal is let Web App know - something happened in
> database...
It isn't ;)

Regards, Clemens


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

Предыдущее
От: Steve Crawford
Дата:
Сообщение: Money casting too liberal?
Следующее
От: Sergey Konoplev
Дата:
Сообщение: Re: bloating index, pg_restore