python / python/cpython

Add eager_tasks parameter to asyncio Runner and run()

Open
#128,289 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib topic-asyncio type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Feature or enhancement

Proposal:

We have an agreement that eager tasks should become defaults in asyncio eventually.

This issue implements the first step: it adds opt-in eager_tasks argument to run() function and Runner constructor.
Later we'll deprecate False value and enforce users to switch to eager tasks in their code.

See the linked discussion for details.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/make-asyncio-eager-task-factory-default/75164/10

Linked PRs
  • gh-128293

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked Discourse discussion first, then locate asyncio.run() and the Runner constructor in CPython's asyncio implementation. Confirm the agreed behavior for the opt-in eager_tasks argument and verify that both entry points accept and apply it as specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.