Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
evilkost committed Apr 15, 2011
1 parent 57f8103 commit 93cca47
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -46,4 +51,3 @@ License
-------
See LICENSE file.
Long story short: WTFPL v2

0 comments on commit 93cca47

Please sign in to comment.