summaryrefslogtreecommitdiff
path: root/doc/src/advanced.rst
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-04-20 18:17:27 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-04-21 15:09:14 +0100
commit02a28ff028b6f06625d2bb1dc4dadd639fbe3b43 (patch)
tree5c6a6b94516af5f11937a98322805756b998222b /doc/src/advanced.rst
parent12ef826d500b2f9bda97032ffa58eb53036272db (diff)
downloadpsycopg2-02a28ff028b6f06625d2bb1dc4dadd639fbe3b43.tar.gz
Notifications are automatically read after each query.
Added tests for basic notifications process.
Diffstat (limited to 'doc/src/advanced.rst')
-rw-r--r--doc/src/advanced.rst15
1 files changed, 10 insertions, 5 deletions
diff --git a/doc/src/advanced.rst b/doc/src/advanced.rst
index a601339..b8ed537 100644
--- a/doc/src/advanced.rst
+++ b/doc/src/advanced.rst
@@ -227,11 +227,16 @@ manner.
.. |NOTIFY| replace:: :sql:`NOTIFY`
.. _NOTIFY: http://www.postgresql.org/docs/8.4/static/sql-notify.html
-Notification are received using the `~connection.poll()` method. A simple
-application could poll the connection from time to time to check if something
-new has arrived. A better strategy is to use some I/O completion function such
-as |select()|_ to sleep until awaken from the kernel when there is some data to
-read on the connection, thereby using no CPU unless there is something to read::
+Notification are received after every query execution. If the user is interested
+in receiveing notification but not in performing any query, the
+`~connection.poll()` method can be used to check for notification without
+wasting resources.
+
+A simple application could poll the connection from time to time to check if
+something new has arrived. A better strategy is to use some I/O completion
+function such as |select()|_ to sleep until awaken from the kernel when there is
+some data to read on the connection, thereby using no CPU unless there is
+something to read::
import select
import psycopg2