7.19. AsyncIO 3rd Party

7.19.1. Unsync

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

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

7.19.2. Twisted

  • Old project

$ pip install twisted

7.19.3. Gevent

  • Actively maintained

  • Greenlets (micro-threads running inside one thread)

$ pip install gevent

7.19.4. Tornado

  • Actively maintained

  • Web framework and asynchronous networking library

  • Open-sourced by Facebook after acquisition of FriendFeed

7.19.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

7.19.6. Trio

  • Python library for async concurrency and I/O

  • Focussed on usability and correctness

  • Introduced nursery (task groups)

7.19.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>