]> git.ipfire.org Git - thirdparty/psycopg.git/commit
fix: include timeout as part of the generators/wait conversation
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 24 Jan 2024 19:51:30 +0000 (19:51 +0000)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 29 Jan 2024 02:25:32 +0000 (02:25 +0000)
commit4dbd5c2fdcf44e01865c95a1688b538458670632
tree83feca9c5f7f662c0d968513361c69d452704d55
parent63cb46c384c94c6f815516643faa27394eb25291
fix: include timeout as part of the generators/wait conversation

So far, the wait functions would have shielded the generators from a
wait timeout. However this behaviour makes impossible to make a
generator interruptible.

Note that the `wait_c` generator was interruptible, but probably it
wasn't doing the right thing. In the `poll` branch, I understand that
the returned ready value, in case of timeout, would have been the same
of the input wait value, because of the input/output nature of the
pollfd struct; I haven't analyzed more deeply the select() case.
psycopg/psycopg/_enums.py
psycopg/psycopg/abc.py
psycopg/psycopg/generators.py
psycopg/psycopg/waiting.py
psycopg_c/psycopg_c/_psycopg/generators.pyx
psycopg_c/psycopg_c/_psycopg/waiting.pyx
tests/test_waiting.py