From ffac113995247122fb62ceb172ceb8621dbfc65c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 22 Feb 2016 14:51:47 +0100 Subject: Update doc --- doc/index.rst | 4 ++-- doc/openstack.rst | 6 ++++++ doc/status.rst | 31 +--------------------------- doc/using.rst | 62 +++++++++++++++++++++++++++---------------------------- 4 files changed, 39 insertions(+), 64 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 6031ade..21e0bef 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -14,8 +14,8 @@ aioeventlet allows to use greenthreads in asyncio coroutines, and to use asyncio coroutines, tasks and futures in greenthreads: see :func:`yield_future` and :func:`wrap_greenthread` functions. -The main visible difference between aioeventlet and trollius is the behaviour of -``run_forever()``: ``run_forever()`` blocks with trollius, whereas it runs in a +The main visible difference between aioeventlet and asyncio is the behaviour of +``run_forever()``: ``run_forever()`` blocks with asyncio, whereas it runs in a greenthread with aioeventlet. It means that aioeventlet event loop can run in an greenthread while the Python main thread runs other greenthreads in parallel. diff --git a/doc/openstack.rst b/doc/openstack.rst index 7d9b340..bef9111 100644 --- a/doc/openstack.rst +++ b/doc/openstack.rst @@ -1,6 +1,12 @@ asyncio in OpenStack ==================== +.. warning:: + The project of replacing eventlet with trollius using aioeventlet in + OpenStack is abandonned. It might done "later" when Python 2 support + will be removed from OpenStack which is not going to happen in a near + future. + First part (in progress): add support for trollius coroutines ------------------------------------------------------------- diff --git a/doc/status.rst b/doc/status.rst index 2519c3d..92fd243 100644 --- a/doc/status.rst +++ b/doc/status.rst @@ -21,34 +21,5 @@ To do eventlet and Python 3 ===================== -eventlet 0.16 or newer is recommanded for Python 3 when monkey-patching is +eventlet 0.17 or newer is recommanded for Python 3 when monkey-patching is enabled. - -eventlet 0.15 is the first release supporting Python 3, its monkey-patching -does not work with Python 3. - -Python 3 pull requests: - -* `Fix threading.Condition with monkey-patching on Python 3.3 and newer #187 - `_ -* `Fix monkey-patched os.open(): add dir_fd parameter #170 - `_, merged! -* `Fix monkey_patch() on Python 3 #168 - `_, merged! -* `Python 3 compat; Improve WSGI, WS, threading and tests #160 - `_ (sent the Nov 5, 2014): - merged! -* `Fix several issues with python3 thread patching #99 - `_ (sent the July 3, 2014): not - merged but it is not more needed (issues fixed by other changes), see the - `commit - `_ - -Python 3 issues: - -* Issue #157: `eventlet hanging - `_ (open since Oct 30, 2014) -* Issue #153: `py3: green.threading.local is not green - `_ (closed the Nov 5, 2014) -* Issue #6: `Support Python 3.3 - `_ (open since Jan 2013) diff --git a/doc/using.rst b/doc/using.rst index 0676268..a87da56 100644 --- a/doc/using.rst +++ b/doc/using.rst @@ -1,26 +1,26 @@ Usage ===== -Use aioeventlet with trollius ------------------------------ - -aioeventlet can be used with trollius, coroutines written with ``yield -From(...)``. Using aioeventlet with trollius is a good start to port project -written for eventlet to trollius. +Use aioeventlet with asyncio +---------------------------- -To use aioeventlet with trollius, set the event loop policy before using an event -loop, example:: +aioeventlet can be used with asyncio, coroutines written with ``yield from ...``. +To use aioeventlet with asyncio, set the event loop policy before using an event +loop. Example:: import aioeventlet - import trollius + import asyncio - trollius.set_event_loop_policy(aioeventlet.EventLoopPolicy()) + asyncio.set_event_loop_policy(aioeventlet.EventLoopPolicy()) # .... +Setting the event loop policy should be enough to examples of the asyncio +documentation with the aioeventlet event loop. + Hello World:: import aioeventlet - import trollius as asyncio + import asyncio def hello_world(): print("Hello World") @@ -33,36 +33,35 @@ Hello World:: loop.close() .. seealso:: - `Trollius documentation `_. + The `asyncio documentation + `_. -Use aioeventlet with asyncio ----------------------------- +Use aioeventlet with trollius +----------------------------- -aioeventlet can be used with asyncio, coroutines written with ``yield from ...``. -To use aioeventlet with asyncio, set the event loop policy before using an event -loop. Example:: +.. warning:: + The `trollius project is now deprecated + `_. It's now recommended to + use aioeventlet with asyncio. - import aioeventlet - import asyncio +aioeventlet can be used with trollius, coroutines written with ``yield +From(...)``. Using aioeventlet with trollius is a good start to port project +written for eventlet to trollius. - asyncio.set_event_loop_policy(aioeventlet.EventLoopPolicy()) - # .... +To use aioeventlet with trollius, set the event loop policy before using an event +loop, example:: -Setting the event loop policy should be enough to examples of the asyncio -documentation with the aioeventlet event loop. + import aioeventlet + import trollius -.. warning:: - Since aioeventlet relies on eventlet, eventlet port to Python 3 is not complete - and asyncio requires Python 3.3 or newer: using aioeventlet with asyncio is not - recommended yet. *Using aioeventlet with trollius should be preferred right - now*. See the :ref:`status of the eventlet port to Python 3 - `. + trollius.set_event_loop_policy(aioeventlet.EventLoopPolicy()) + # .... Hello World:: import aioeventlet - import asyncio + import trollius as asyncio def hello_world(): print("Hello World") @@ -75,8 +74,7 @@ Hello World:: loop.close() .. seealso:: - The `asyncio documentation - `_. + `Trollius documentation `_. Threads -- cgit v1.2.1