8000 gh-97696 Remove unnecessary check for eager_start kwarg by jbower-fb · Pull Request #104188 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-97696 Remove unnecessary check for eager_start kwarg #104188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add docstring to create_eager_task_factory
  • Loading branch information
jbower-fb authored May 6, 2023
commit 86c8b430abd123c99aab11cec73c0fc274662b02
7 changes: 7 additions & 0 deletions Lib/asyncio/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,13 @@ def callback():


def create_eager_task_factory(custom_task_constructor):
"""
Creates a function suitable for use as a task factory on an event-loop.
The tasks created will be started immediately (rather than being first
scheduled to an event loop). The constructor argument can be any callable
that constructs a Task-compatible object and supports the eager_start
keyword argument.
"""

def factory(loop, coro, *, name=None, context=None):
return custom_task_constructor(
Expand Down
0