]> granicus.if.org Git - python/commitdiff
docs/asyncio: Document set_task_factory/get_task_factory
authorYury Selivanov <yselivanov@sprymix.com>
Mon, 11 May 2015 20:28:27 +0000 (16:28 -0400)
committerYury Selivanov <yselivanov@sprymix.com>
Mon, 11 May 2015 20:28:27 +0000 (16:28 -0400)
Doc/library/asyncio-eventloop.rst

index d27eb4bd8289edaeb0c2b6cba90ec7a46de31751..e1a9da14098bb14ec22218215e4f0bc58f46fcd5 100644 (file)
@@ -181,6 +181,26 @@ Coroutines
 
    .. versionadded:: 3.4.2
 
+.. method:: BaseEventLoop.set_task_factory(factory)
+
+   Set a task factory that will be used by
+   :meth:`BaseEventLoop.create_task`.
+
+   If *factory* is ``None`` the default task factory will be set.
+
+   If *factory* is a *callable*, it should have a signature matching
+   ``(loop, coro)``, where *loop* will be a reference to the active
+   event loop, *coro* will be a coroutine object.  The callable
+   must return an :class:`asyncio.Future` compatible object.
+
+   .. versionadded:: 3.4.4
+
+.. method:: BaseEventLoop.get_task_factory()
+
+   Return a task factory, or ``None`` if the default one is in use.
+
+   .. versionadded:: 3.4.4
+
 
 Creating connections
 --------------------