Skip to content

fix: wait for each write to finish - #321

Merged
gabor-boros merged 1 commit into
masterfrom
wait-for-write
Nov 16, 2026
Merged

gabor-boros merged 1 commit into
masterfrom
wait-for-write

Conversation

@gabor-boros

Copy link
Copy Markdown
Member

Reason for the change

related to #223

Description

Wait for each write to finish.

Code examples

import asyncio

from rethinkdb import r
from rethinkdb.errors import ReqlOpFailedError


async def main() -> None:
    r.set_loop_type("asyncio")
    conn = await r.connect(host="localhost", port=28015)
    try:
        try:
            await r.db_create("demo").run(conn)
        except ReqlOpFailedError:
            pass

        try:
            await r.db("demo").table_create("people").run(conn)
        except ReqlOpFailedError:
            pass

        await (
            r.db("demo")
            .table("people")
            .insert({"id": "ada", "name": "Ada"}, conflict="replace")
            .run(conn)
        )

        person = await r.db("demo").table("people").get("ada").run(conn)
        print(person)

        cursor = await r.db("demo").table("people").run(conn)
        async for row in cursor:
            print(row)
    finally:
        await conn.close()


if __name__ == "__main__":
    asyncio.run(main())

Checklist

References

N/A

@gabor-boros
gabor-boros merged commit e02c553 into master Nov 16, 2026
13 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant