Skip to content

Commit da2f650

Browse files
docs: fix misleading close() docstring — only idle connections are closed
The close() docstring said "Close all connections (both idle and in-use)" but since the #080 fix, it only closes idle connections. In-use connections are closed when their acquire() context manager exits. Update the docstring to accurately describe this behavior and guide users on how to ensure full cleanup. Closes #092 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1edc2b5 commit da2f650

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/dqliteclient/pool.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,14 @@ async def fetch(self, sql: str, params: Sequence[Any] | None = None) -> list[dic
185185
return await conn.fetch(sql, params)
186186

187187
async def close(self) -> None:
188-
"""Close all connections (both idle and in-use)."""
188+
"""Close the pool and all idle connections.
189+
190+
Sets the pool as closed so no new connections can be acquired.
191+
Idle connections are closed immediately. In-use connections are
192+
closed when they are returned (when the acquire() context manager
193+
exits). To ensure all connections are closed, cancel or await
194+
in-flight tasks before calling close().
195+
"""
189196
self._closed = True
190197

191198
# Close idle connections

0 commit comments

Comments
 (0)