Python: Model more awaiting construcs

in API graphs.
Some unsatisfactory lack of understanding here.
This commit is contained in:
Rasmus Lerchedahl Petersen
2021-09-27 16:41:01 +02:00
parent f6311bf051
commit 3c1206f873
3 changed files with 49 additions and 7 deletions

View File

@@ -70,7 +70,7 @@ async def test_connection_pool():
await pool.fetchval("sql") # $ getSql="sql"
async with pool.acquire() as conn:
await conn.execute("sql") # $ MISSING: getSql="sql"
await conn.execute("sql") # $ getSql="sql"
conn = await pool.acquire()
try:
@@ -82,13 +82,13 @@ async def test_connection_pool():
await pool.close()
async with asyncpg.create_pool() as pool:
await pool.execute("sql") # $ MISSING: getSql="sql"
await pool.execute("sql") # $ getSql="sql"
async with pool.acquire() as conn:
await conn.execute("sql") # $ MISSING: getSql="sql"
await conn.execute("sql") # $ getSql="sql"
conn = await pool.acquire()
try:
await conn.fetch("sql") # $ MISSING: getSql="sql"
await conn.fetch("sql") # $ getSql="sql"
finally:
await pool.release(conn)