]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
docs: add docs about timeout and stop_after notification parameters
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 27 Jan 2024 02:51:20 +0000 (02:51 +0000)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 29 Jan 2024 02:25:32 +0000 (02:25 +0000)
docs/advanced/async.rst
docs/api/connections.rst
docs/news.rst

index bf75260711d02d2004e4975d4e77c15655b8f215..ef1f6c1513ba3fe6f1c0bbedcc617e19f519b343 100644 (file)
@@ -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::
 
index a607f07fa5191676d361f97f5fe14d5a34d6806e..898a8470d4da756a3567b753b85571437cad1bb7 100644 (file)
@@ -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
index 5c201a44da7b1c509dc496482b469fe20cda7898..cecffd40cdad160673d0dcb1b7326d7ddf1a240e 100644 (file)
@@ -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