]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
refactor: auto-generate sync pipeline object from async one
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 5 Sep 2025 23:57:52 +0000 (01:57 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 6 Sep 2025 20:14:20 +0000 (22:14 +0200)
psycopg/psycopg/_pipeline.py
psycopg/psycopg/_pipeline_async.py
tools/async_to_sync.py

index a32064af73c0240d0d50172f83667aa5eca57c55..1276f434aea4d0c6ffcdb6c33dcf2001209b98e6 100644 (file)
@@ -1,5 +1,8 @@
+# WARNING: this file is auto-generated by 'async_to_sync.py'
+# from the original file '_pipeline_async.py'
+# DO NOT CHANGE! Change the original file instead.
 """
-commands pipeline management
+Psycopg Pipeline object implementation.
 """
 
 # Copyright (C) 2021 The Psycopg Team
@@ -21,7 +24,7 @@ logger = logging.getLogger("psycopg")
 
 
 class Pipeline(BasePipeline):
-    """Handler for connection in pipeline mode."""
+    """Handler for (sync) connection in pipeline mode."""
 
     __module__ = "psycopg"
     _conn: Connection[Any]
index dd4deca6581644ef6beade9631d3bc1a85c3021d..058526071478fe80fbbb8f080fe5390fbd162ae5 100644 (file)
@@ -1,5 +1,5 @@
 """
-commands pipeline management
+Psycopg AsyncPipeline object implementation.
 """
 
 # Copyright (C) 2021 The Psycopg Team
@@ -21,7 +21,7 @@ logger = logging.getLogger("psycopg")
 
 
 class AsyncPipeline(BasePipeline):
-    """Handler for async connection in pipeline mode."""
+    """Handler for (async) connection in pipeline mode."""
 
     __module__ = "psycopg"
     _conn: AsyncConnection[Any]
@@ -30,6 +30,9 @@ class AsyncPipeline(BasePipeline):
         super().__init__(conn)
 
     async def sync(self) -> None:
+        """Sync the pipeline, send any pending command and receive and process
+        all available results.
+        """
         try:
             async with self._conn.lock:
                 await self._conn.wait(self._sync_gen())
index 6b3012df204338628063c5cc9712cae4e6cf30cd..87df50135cfc23ac634df12cd9032d3aff6b26f0 100755 (executable)
@@ -34,6 +34,7 @@ ALL_INPUTS = """
     psycopg/psycopg/_copy_async.py
     psycopg/psycopg/connection_async.py
     psycopg/psycopg/cursor_async.py
+    psycopg/psycopg/_pipeline_async.py
     psycopg/psycopg/_server_cursor_async.py
     psycopg_pool/psycopg_pool/null_pool_async.py
     psycopg_pool/psycopg_pool/pool_async.py