psycopg.git / summary / log / commit / refs
commit a3ea3630b43a6c836f02549a6f1663291d2cd3fa
Author: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Date: Sat Jan 27 02:51:20 2024 +0000
docs: add docs about timeout and stop_after notification parameters
docs/advanced/async.rst | 3 ++-
docs/api/connections.rst | 9 +++++++++
docs/news.rst | 2 ++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/docs/advanced/async.rst b/docs/advanced/async.rst
index bf752607..ef1f6c15 100644
--- a/docs/advanced/async.rst
+++ b/docs/advanced/async.rst
@@ -334,7 +334,8 @@ mode if you wish to receive or send notifications in a timely manner.
Notifications are received as instances of `Notify`. If you are reserving a
connection only to receive notifications, the simplest way is to consume the
`Connection.notifies` generator. The generator can be stopped using
-`!close()`.
+`!close()`. Starting from Psycopg 3.2, the method supports options to receive
+notifications only for a certain time or up to a certain number.
.. note::
diff --git a/docs/api/connections.rst b/docs/api/connections.rst
index a607f07f..898a8470 100644
--- a/docs/api/connections.rst
+++ b/docs/api/connections.rst
@@ -286,6 +286,10 @@ The `!Connection` class
any sessions in the database generates a :sql:`NOTIFY` on one of the
listened channels.
+ .. versionchanged:: 3.2
+
+ Added `!timeout` and `!stop_after` parameters.
+
.. automethod:: add_notify_handler
See :ref:`async-notify` for details.
@@ -494,6 +498,11 @@ The `!AsyncConnection` class
...
.. automethod:: notifies
+
+ .. versionchanged:: 3.2
+
+ Added `!timeout` and `!stop_after` parameters.
+
.. automethod:: set_autocommit
.. automethod:: set_isolation_level
.. automethod:: set_read_only
diff --git a/docs/news.rst b/docs/news.rst
index 5c201a44..cecffd40 100644
--- a/docs/news.rst
+++ b/docs/news.rst
@@ -15,6 +15,8 @@ Psycopg 3.2 (unreleased)
- Add support for integer, floating point, boolean `NumPy scalar types`__
(:ticket:`#332`).
+- Add `!timeout` and `!stop_after` parameters to `Connection.notifies()`
+ (:ticket:`340`).
- Add :ref:`raw-query-cursors` to execute queries using placeholders in
PostgreSQL format (`$1`, `$2`...) (:ticket:`#560`).
- Add `~Connection.set_autocommit()` on sync connections, and similar
[parent: f88dcbc0a314]