Permalink
Browse files

update README.md

  • Loading branch information...
1 parent 57f8103 commit 93cca470fa89e4cb0745f9673e95ba32ea2f38c6 @evilkost committed Apr 15, 2011
Showing with 8 additions and 4 deletions.
  1. +8 −4 README.md
View
12 README.md
@@ -3,24 +3,28 @@ brükva
Asynchronous [Redis](http://redis.io/) client that works within [Tornado](http://tornadoweb.org/) IO loop.
-
Usage
-----
Input:
+
import logging
logging.basicConfig()
import brukva
c = brukva.Client()
c.connect()
+ loop = c.connection._stream.io_loop
+
def on_result(result):
print result
c.set('foo', 'bar', on_result)
c.get('foo', on_result)
- c.hgetall('foo', on_result)
- c.connection._stream.io_loop.start() # start tornado mainloop
+ c.hgetall('foo', [on_result, lambda r: loop.stop()] )
+
+ loop.start() # start tornado mainloop
Output:
+
True
bar
ERROR:brukva.client:ResponseError (on HGETALL [('foo',), {}]): Operation against a key holding the wrong kind of value
@@ -29,6 +33,7 @@ Output:
Tips on testing
---------------
+Run redis-server on localhost:6379 with option "timeout 1".
Run tests with the following command:
./run_nose.sh
@@ -46,4 +51,3 @@ License
-------
See LICENSE file.
Long story short: WTFPL v2
-

0 comments on commit 93cca47

Please sign in to comment.