Skip to content

hyace/ioloop_redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ioloop_redis

another async redis lib for tornado, short and intuitive


##Sample

from __future__ import absolute_import
from tornado import httpserver
from tornado.web import Application, RequestHandler
from tornado.gen import coroutine
from redis_client import *


_queue = AsyncRedis('redis://localhost:6379/1')


class HelloworldHandler(RequestHandler):
    @coroutine
    def get(self):
        next_cmd = yield _queue.invoke(redis_lpop('key'))
        #do sth.
        self.write(next_cmd)
        self.finish()


def main():
    app = Application([
        ('/', HelloworldHandler),
    ])

    server = httpserver.HTTPServer(app)
    server.listen(8000)
    IOLoop.instance().start()


if __name__ == "__main__":
    main()

About

another async redis lib for tornado, short and intuitive

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published