mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-128307: Support eager_start=<bool> in create_eager_task_factory and various create_task functions (#128306)
Some create_task() functions were changed from `name=None, context=None` to `**kwargs`. Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
This commit is contained in:
parent
c4cc5d58ae
commit
08d7687094
7 changed files with 85 additions and 19 deletions
|
@ -361,7 +361,7 @@ Creating Futures and Tasks
|
|||
|
||||
.. versionadded:: 3.5.2
|
||||
|
||||
.. method:: loop.create_task(coro, *, name=None, context=None)
|
||||
.. method:: loop.create_task(coro, *, name=None, context=None, eager_start=None)
|
||||
|
||||
Schedule the execution of :ref:`coroutine <coroutine>` *coro*.
|
||||
Return a :class:`Task` object.
|
||||
|
@ -377,12 +377,20 @@ Creating Futures and Tasks
|
|||
custom :class:`contextvars.Context` for the *coro* to run in.
|
||||
The current context copy is created when no *context* is provided.
|
||||
|
||||
An optional keyword-only *eager_start* argument allows specifying
|
||||
if the task should execute eagerly during the call to create_task,
|
||||
or be scheduled later. If *eager_start* is not passed the mode set
|
||||
by :meth:`loop.set_task_factory` will be used.
|
||||
|
||||
.. versionchanged:: 3.8
|
||||
Added the *name* parameter.
|
||||
|
||||
.. versionchanged:: 3.11
|
||||
Added the *context* parameter.
|
||||
|
||||
.. versionchanged:: next
|
||||
Added the *eager_start* parameter.
|
||||
|
||||
.. method:: loop.set_task_factory(factory)
|
||||
|
||||
Set a task factory that will be used by
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue