Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7185461

Browse files
committed
docs/asyncio: Document set_task_factory/get_task_factory
1 parent 5d87ec2 commit 7185461

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Doc/library/asyncio-eventloop.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,26 @@ Coroutines
181181

182182
.. versionadded:: 3.4.2
183183

184+
.. method:: BaseEventLoop.set_task_factory(factory)
185+
186+
Set a task factory that will be used by
187+
:meth:`BaseEventLoop.create_task`.
188+
189+
If *factory* is ``None`` the default task factory will be set.
190+
191+
If *factory* is a *callable*, it should have a signature matching
192+
``(loop, coro)``, where *loop* will be a reference to the active
193+
event loop, *coro* will be a coroutine object. The callable
194+
must return an :class:`asyncio.Future` compatible object.
195+
196+
.. versionadded:: 3.4.4
197+
198+
.. method:: BaseEventLoop.get_task_factory()
199+
200+
Return a task factory, or ``None`` if the default one is in use.
201+
202+
.. versionadded:: 3.4.4
203+
184204

185205
Creating connections
186206
--------------------

0 commit comments

Comments
 (0)