Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Clarify multi-threading options #291

@remram44

Description

@remram44

If I want to run a long operation, I would want to do it in a thread to not block the async event-loop. asyncio provides run_in_executor() for exactly this. However, it is not clear whether my databases.Database object is safe to use in the thread, and whether there is something I can do to make it work (short of creating a brand new sa.Engine and sa.Connection with SQLAlchemy from the original URL. Or maybe one sa.Engine for the whole thread pool?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions