Skip to content

Add a API to start a coroutine. #126936

@ZTG0421

Description

@ZTG0421

Feature or enhancement

Proposal:

Add a new API to behave like loop.run_until_complete(asyncio.sleep(0)), which runs all tasks in the loop until the first await. This helps to return control to the main thread like in JavaScript, instead of returning to the event loop.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-asynciotype-featureA feature request or enhancement

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions