Skip to content

Instantly share code, notes, and snippets.

@ityoung
Created May 22, 2019 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ityoung/6d942151426f56e8410fb200edf2bca6 to your computer and use it in GitHub Desktop.
Save ityoung/6d942151426f56e8410fb200edf2bca6 to your computer and use it in GitHub Desktop.
An index.py example of Tornado
import asyncio
from handler import server
from libs.redis import MyRedis
async def init_redis():
await MyRedis.redis()
if __name__ == '__main__':
server.bind(8080)
server.start()
ioloop = asyncio.get_event_loop()
ioloop.run_until_complete(init_redis())
ioloop.run_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment