Giter Site home page Giter Site logo

gruvi's Introduction

Welcome to Gruvi

https://secure.travis-ci.org/geertj/gruvi.png https://coveralls.io/repos/geertj/gruvi/badge.png?branch=master https://badge.fury.io/py/gruvi.png

Gruvi is an IO library for Python. It 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 event-based callback model.

Gruvi is similar in concept to asyncio, gevent, and eventlet. For a rationale on why I've created a new library, see the Rationale section in the manual.

Features

Gruvi has the following features:

  • Excellent platform support (mostly thanks to libuv). Linux, Mac OSX and Windows are all first-class citizens. On Windows IOCP is used meaning that you don't run into the scalability limitations of select() there.
  • Small core and focus on low memory usage and fast performance. This makes Gruvi very suitable for mobile applications and embedded web servers.
  • Great support for SSL, also on Windows. Includes an SSL backports module that makes certain 3.x features available on Python 2.7.
  • Built-in client/server support for HTTP, JSON-RPC and D-BUS.
  • PEP-3156 compatible transport/protocol interface.
  • Transparent concurrency support. Thanks to fibers, calling into a blocking function is just like calling into a regular function.
  • Thread synchronization primitives including locks, conditions and queues.
  • Thread and fiber pools with a concurrent.futures interface.

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))
gruvi.get_hub().switch()

Requirements

You need Python 2.7 or 3.3+.

The following operating systems are currently tested:

  • Posix (Only Linux is currently tested)
  • Mac OSX
  • Windows

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, available 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.

gruvi's People

Contributors

geertj avatar tijko avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.