Created
September 18, 2019 13:22
-
-
Save kristoff-it/97decafe70b1644948bb73db1cd9f94d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio, aioredis | |
async def main(): | |
pool = await aioredis.create_redis_pool('localhost', | |
db=0, password=None, ssl=False, minsize=4, maxsize=10, encoding='utf8') | |
# No need to pluck a single connection | |
# aioredis will schedule your command to | |
# a random connection inside the pool. | |
await pool.set("key", "hello world") | |
await pool.incrby("counter", 3) | |
if __name__ == '__main__': | |
loop = asyncio.main_loop() | |
loop.run_until_complete(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment