tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

gevent-example.rst (707B)


      1 Gevent Example Server
      2 =====================
      3 
      4 This example is a basic HTTP/2 server written using `gevent`_, a powerful
      5 coroutine-based Python networking library that uses `greenlet`_
      6 to provide a high-level synchronous API on top of the `libev`_ or `libuv`_
      7 event loop.
      8 
      9 This example is inspired by the curio one and also demonstrates the correct use
     10 of HTTP/2 flow control with h2 and how gevent can be simple to use.
     11 
     12 .. literalinclude:: ../../examples/gevent/gevent-server.py
     13   :language: python
     14   :linenos:
     15   :encoding: utf-8
     16 
     17 .. _gevent: http://www.gevent.org/
     18 .. _greenlet: https://greenlet.readthedocs.io/en/latest/
     19 .. _libev: http://software.schmorp.de/pkg/libev.html
     20 .. _libuv: http://libuv.org/