Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 52 lines (37 sloc) 1.208 kb
0cbef57 @kmerenkov Renamed project from rutabaga to brukva
kmerenkov authored
1 brükva
e3f945f @kmerenkov Added README
kmerenkov authored
2 ========
3
f98f7ff @evilkost fix #3: broken sample usage in README
authored
4 Asynchronous [Redis](http://redis.io/) client that works within [Tornado](http://tornadoweb.org/) IO loop.
e3f945f @kmerenkov Added README
kmerenkov authored
5
6 Usage
7 -----
8
f98f7ff @evilkost fix #3: broken sample usage in README
authored
9 Input:
93cca47 @evilkost update README.md
authored
10
f98f7ff @evilkost fix #3: broken sample usage in README
authored
11 import logging
12 logging.basicConfig()
13 import brukva
14 c = brukva.Client()
15 c.connect()
93cca47 @evilkost update README.md
authored
16 loop = c.connection._stream.io_loop
f98f7ff @evilkost fix #3: broken sample usage in README
authored
17 def on_result(result):
18 print result
19 c.set('foo', 'bar', on_result)
20 c.get('foo', on_result)
d47eff4 @evilkost fix #7: call callbacks through context.ret_call
authored
21 c.hgetall('foo', [on_result, lambda r: loop.stop()])
93cca47 @evilkost update README.md
authored
22 loop.start() # start tornado mainloop
f98f7ff @evilkost fix #3: broken sample usage in README
authored
23
24 Output:
93cca47 @evilkost update README.md
authored
25
e3f945f @kmerenkov Added README
kmerenkov authored
26 True
27 bar
f98f7ff @evilkost fix #3: broken sample usage in README
authored
28 ERROR:brukva.client:ResponseError (on HGETALL [('foo',), {}]): Operation against a key holding the wrong kind of value
e3f945f @kmerenkov Added README
kmerenkov authored
29 ResponseError (on HGETALL [('foo',), {}]): Operation against a key holding the wrong kind of value
30
d5db86f @kmerenkov Updated readme (added test command)
kmerenkov authored
31 Tips on testing
32 ---------------
33
93cca47 @evilkost update README.md
authored
34 Run redis-server on localhost:6379 with option "timeout 1".
d5db86f @kmerenkov Updated readme (added test command)
kmerenkov authored
35 Run tests with the following command:
36
f98f7ff @evilkost fix #3: broken sample usage in README
authored
37 ./run_nose.sh
d5db86f @kmerenkov Updated readme (added test command)
kmerenkov authored
38
39
e3f945f @kmerenkov Added README
kmerenkov authored
40 Credits
41 -------
0cbef57 @kmerenkov Renamed project from rutabaga to brukva
kmerenkov authored
42 brukva is developed and maintained by [Konstantin Merenkov](mailto:kmerenkov@gmail.com)
e3f945f @kmerenkov Added README
kmerenkov authored
43
44 * Inspiration: [redis-py](http://github.com/andymccurdy/redis-py)
45 * Third-party software: [adisp](https://code.launchpad.net/adisp)
46
661fc9e @kmerenkov Added LICENSE, mentioned it in readme.
kmerenkov authored
47
48 License
49 -------
50 See LICENSE file.
51 Long story short: WTFPL v2
Something went wrong with that request. Please try again.