8.21. AsyncIO 3rd Party

8.21.1. Unsync

  • Library decides which to run, thread, asyncio or sync

$ pip install unsync
@unsync
def my_function():
    pass

8.21.2. Twisted

  • Old project

$ pip install twisted

8.21.3. Gevent

  • Actively maintained

  • Greenlets (micro-threads running inside one thread)

$ pip install gevent

8.21.4. Tornado

  • Actively maintained

  • Web framework and asynchronous networking library

  • Open-sourced by Facebook after acquisition of FriendFeed

8.21.5. Curio

  • Coroutine-based library for concurrent Python systems programming

  • Provides standard programming abstractions such as tasks, sockets, files, locks and queues

  • Works on POSIX and Windows

8.21.6. Trio

  • Python library for async concurrency and I/O

  • Focussed on usability and correctness

  • Introduced nursery (task groups)

8.21.7. UVLoop

  • The ultimate loop implementation for UNIXes (run this on production)

$ pip install uvloop
>>> 
... import uvloop
...
... uvloop.install()
...
... loop = asyncio.new_event_loop()
... loop
<uvloop.Loop running=False closed=False debug=False>