Skip to main content
Help us improve Python packaging – donate today!

Async Redis connection object using Greenlets and Tornado

Project Description

An asynchronous redis::Connection object using Greenlets and Tornado’s event-loop.

Requires

Installation

pip install gretis

Getting Started

With redis-py:

Create a redis ConnectionPool instructing it to use the Gretis AsyncConnection as its connection. You must have a parent greenlet or you will get an exception. (Examples assume you are in greenlet context already)

import redis
from gretis.async_connection import AsyncConnection

pool = redis.ConnectionPool(connection_class=AsyncConnection,
    host='localhost', port=6379, db=0, socket_timeout=1)
r = redis.StrictRedis(connection_pool=pool)
r.set('foo', 'bar')

Or with redis-cluster-py:

Create a redis cluster ConnectionPool and give it an AsyncClusterConnection.

import redis
from gretis.async_cluster_connection import AsyncClusterConnection
from rediscluster import ClusterConnectionPool, StrictClusterRedis

pool = ClusterConnectionPool(connection_class=AsyncClusterConnection,
    host='localhost', port=700, socket_timeout=1)
r = StrictRedisCluster(connection_pool=pool)
r.set('foo', 'bar')

Release history Release notifications

This version
History Node

0.0.11

History Node

0.0.10

History Node

0.0.9

History Node

0.0.8

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
gretis-0.0.11.tar.gz (5.1 kB) Copy SHA256 hash SHA256 Source None Mar 14, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page