All Projects → geertj → Gruvi

geertj / Gruvi

Licence: mit
Async IO for Python, Simplified

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Gruvi

Uvloop
Ultra fast asyncio event loop.
Stars: ✭ 8,246 (+8489.58%)
Mutual labels:  async, libuv
Mioco
[no longer maintained] Scalable, coroutine-based, fibers/green-threads for Rust. (aka MIO COroutines).
Stars: ✭ 125 (+30.21%)
Mutual labels:  async, fibers
Igropyr
a async http server base on libuv for Chez Scheme
Stars: ✭ 85 (-11.46%)
Mutual labels:  async, libuv
Fibrous
Easily mix asynchronous and synchronous programming styles in node.js.
Stars: ✭ 183 (+90.63%)
Mutual labels:  async, fibers
Node Procedural Async
Write procedural style code that runs asynchronously. It may look synchronous, but it's not!
Stars: ✭ 17 (-82.29%)
Mutual labels:  async, fibers
S task
awaitable coroutine library for C
Stars: ✭ 317 (+230.21%)
Mutual labels:  async, libuv
Minicoro
Single header asymmetric stackful cross-platform coroutine library in pure C.
Stars: ✭ 164 (+70.83%)
Mutual labels:  async, fibers
May
rust stackful coroutine library
Stars: ✭ 909 (+846.88%)
Mutual labels:  async, fibers
Gaia
C++ framework for rapid server development
Stars: ✭ 58 (-39.58%)
Mutual labels:  async, fibers
Async Retry
Retrying made simple, easy and async
Stars: ✭ 1,262 (+1214.58%)
Mutual labels:  async
Alecrimasynckit
async and await for Swift.
Stars: ✭ 89 (-7.29%)
Mutual labels:  async
Run Waterfall
Run an array of functions in series, each passing its results to the next function
Stars: ✭ 83 (-13.54%)
Mutual labels:  async
Dazzle
Next-Gen Async Library for PHP
Stars: ✭ 90 (-6.25%)
Mutual labels:  async
Branchy
🍃 Execute a Node.js function in a separate process
Stars: ✭ 84 (-12.5%)
Mutual labels:  async
Event Store Client
PHP 7.4 Event Store Client Implementation
Stars: ✭ 93 (-3.12%)
Mutual labels:  async
Websocket Client
Async WebSocket client for PHP based on Amp.
Stars: ✭ 83 (-13.54%)
Mutual labels:  async
Dns
Async DNS resolution for PHP based on Amp.
Stars: ✭ 82 (-14.58%)
Mutual labels:  async
Swimmer
🏊 Swimmer - An async task pooling and throttling utility for JS
Stars: ✭ 94 (-2.08%)
Mutual labels:  async
Uvicorn Gunicorn Starlette Docker
Docker image with Uvicorn managed by Gunicorn for high-performance Starlette web applications in Python 3.7 and 3.6 with performance auto-tuning. Optionally with Alpine Linux.
Stars: ✭ 92 (-4.17%)
Mutual labels:  async
Object Observer
Object Observer functionality of JavaScript objects/arrays via native Proxy
Stars: ✭ 88 (-8.33%)
Mutual labels:  async

Gruvi: Async IO for Python, Simplified


.. image:: https://secure.travis-ci.org/geertj/gruvi.png :target: http://travis-ci.org/geertj/gruvi

.. image:: https://coveralls.io/repos/geertj/gruvi/badge.png?branch=master :target: https://coveralls.io/r/geertj/gruvi?branch=master

.. image:: https://badge.fury.io/py/gruvi.png :target: http://badge.fury.io/py/gruvi

Improved ergonomics for Python programmers wanting to use asynchronous IO.

Gruvi is an asynchronous IO library for Python. It focuses on the following desirable properties:

  • Simple. Async IO code should look just like normal code, with simple, sequential control flow and regular functions.

  • Efficient. An IO library should have a very low memory and CPU overhead, so that it can scale to small systems or to many concurrent connections.

  • Powerful. Common protocols like SSL/TLS and HTTP should be part of every IO library.

Gruvi uses libuv_ (via pyuv_) as the underlying high-performance event-based I/O layer, and coroutines based on fibers_ to create a traditional sequential programming model on top of the libuv_ completion/callback model.

Gruvi is similar in concept existing async IO frameworks like asyncio_, gevent_, and eventlet_. For a comparison, see Rationale_.

Features

Gruvi has the following features:

  • Excellent platform support (mostly thanks to libuv). Linux, Mac OSX and Windows are all first-class citizens.
  • PEP-3156 compatible transport/protocol interface.
  • A traditional, sequential programming model based on green threads, where there is no distinction between asynchronous and normal functions.
  • Great SSL/TLS support, also on Windows. The asynchronous SSL_ support in the Python standard library came from Gruvi before it was included into the stdlib.
  • Small core and focus on low memory usage and fast performance. This makes Gruvi very suitable for mobile applications and embedded web servers.
  • A full suite of synchronization primitives including locks, conditions and queues.
  • Thread and fiber pools with a concurrent.futures interface.
  • Batteries includes: built-in client/server support for HTTP, JSON-RPC and D-BUS.
  • Support for Python 2.7.x and 3.3+.

Example

An simple echo server, using a StreamServer_::

import gruvi

def echo_handler(stream, transport, protocol): while True: buf = stream.read1() if not buf: break stream.write(buf)

server = gruvi.StreamServer(echo_handler) server.listen(('localhost', 7777)) server.run()

Requirements

You need Python 2.7 or 3.3+.

The following operating systems are currently supported:

  • Linux (might work on other Posix OSs)
  • macOS (not currently tested via CI)
  • Windows (not currently tested via CI)

Installation

Development install in a virtualenv::

$ git clone https://github.com/geertj/gruvi $ cd gruvi $ pip install -r requirements.txt $ python setup.py build $ python setup.py install

To run the test suite::

$ python runtests.py unit

For other installation options, see the Installation_ section in the manual.

Documentation

The documentation is available on readthedocs_.

License

Gruvi is free software, provided under the MIT license.

Contact

Feel free to contact the author at [email protected]. You can also submit tickets or suggestions for improvements on Github_.

.. _libuv: https://github.com/libuv/libuv .. _pyuv: http://pyuv.readthedocs.org/en/latest .. _fibers: http://python-fibers.readthedocs.org/en/latest .. _asyncio: http://docs.python.org/3.4/library/asyncio.html .. _gevent: http://gevent.org/ .. _eventlet: http://eventlet.net/ .. _Rationale: http://gruvi.readthedocs.org/en/latest/rationale.html .. _asynchronous SSL: https://docs.python.org/3/library/ssl.html#ssl.SSLObject .. _StreamServer: http://gruvi.readthedocs.org/en/latest/streams.html .. _Installation: http://gruvi.readthedocs.org/en/latest/install.html .. _readthedocs: https://gruvi.readthedocs.org/ .. _Github: https://github.com/geertj/gruvi

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].