gredis
gRedis is an asynchronous client library of Redis written with Tornado coroutine.
gRedis is standing on the shoulders of giants:
Installation
pip install gredis
OR
easy_install gredis
OR
git clone https://github.com/coldnight/gredis
cd gredis
python setup.py install
Usage
from tornado import gen
from tornado import web
from gredis.client import AsyncRedis
client = AsyncRedis("ip.or.host", 6379)
class DemoHandler(web.RequestHandler):
@gen.coroutine
def get(self):
ret = yield client.incr("key")
redis = client.to_blocking_client()
ret2 = redis.incr("key")
self.write(str(ret + ret2))
Pub/Sub
from tornado import gen
from tornado import web
from gredis.client import AsyncRedis
client = AsyncRedis("ip.or.host", 6379)
class PubSubHandler(web.RequestHandler):
@gen.coroutine
def get(self):
pubsub = client.pubsub()
channel = "test"
yield pubsub.subscribe(channel)
response = yield pubsub.get_message(True)
assert response["type"] == "subscribe"
response = yield pubsub.get_message(True)
assert response["type"] == "message"
self.write(response['data'])
@gen.coroutine
def post(self):
yield client.publish(channel, "test")
Not Implementation
pipeline
Metadata
Release files for gredis 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gredis-0.0.9.tar.gz | 5.5 kB | Without provenance | Details for gredis-0.0.9.tar.gz |
Release files / gredis-0.0.9.tar.gz
| Download URL | gredis-0.0.9.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b1e65e77cba2dfd1dda5a91e0a6e672478b343e004918dc95b1743ac118ceed
|
|
BLAKE2b-256 checksum How to use checksums |
7df0fe6722590ad3b65ce0834b7eb50e2f5bdc78fd5724d4437ca03f329a0c34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for gredis 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.