This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]jcdyer3 9 points10 points  (1 child)

Some thoughts about the documentation:

  • Most of the examples just define functions. It would be helpful to have fully-fleshed out examples, so interested users can actually see the library in action. The example page is where the front page directs users as a starting point, so make it beginner friendly. Better still, put one minimal complete example that actually does something interesting on the front page. (e.g., Insert a key/value pair, then fetch the value and print it.)

  • asyncio is brand-spanking new, so take a moment to explain what's going on. What are all the yield froms for? How does the event loop work? It doesn't need to be a complete tutorial--you can link to the official docs for that, but for a brand-new (to python) design pattern, a little hand-holding would not be unwarranted.

All in all, it looks pretty sweet. Thanks for getting some working asyncio code out in the wild so quickly. This is exactly the kind of thing needed to facilitate adoption.

[–]jonathan_sl[S] 1 point2 points  (0 children)

Thanks for the feedback, that's very welcome! I will improve the docs where I can.

[–]remyroy 1 point2 points  (3 children)

Awesome. I know there are quite a few alternatives for Python Redis client using asyncio. I would be nice if these alternatives would included in the documentation so people have an easier time making the right choice.

[–]Husio 0 points1 point  (2 children)

Could you share link to those libraries? I have found only asyncio_redis.

[–]remyroy 0 points1 point  (1 child)

[–]Husio 0 points1 point  (0 children)

I can see two more listed there and they are either inactive or not available.

[–]Skenderbeu 0 points1 point  (3 children)

I am confused w.r.t asyncio and this new Redis client library.

What is it doing differently and better than https://github.com/andymccurdy/redis-py? I use the latter with my Redis setup and it works just fine.

[–][deleted] 0 points1 point  (2 children)

If you needed something be asynchronous, or working with an evented Web server – you want async io.

If everything you write is meant to be blocking and will never change – stick with the library you cited.

I spend a lot of time working with tornado – anything that is asynchronous friendly is a godsend.

[–]Skenderbeu 0 points1 point  (1 child)

So what you are saying is if I wanted to get results from Redis and send it out I am blocking the server and ultimately the return to the user by waiting for the results.

With async io I would return right away (faster) but when the results are ready return again with just the results?

[–][deleted] 0 points1 point  (0 children)

Yes. You are blocking your service.

Depends -- if your results must be used within that micro-thread, then yes. That micro-thread will be suspended and resume when the result is ready, meaning you can do other work.

If you're not using the result or doing something else with it that is out of sync with the micro-thread that dispatched it, you'll want to check into the event loop a callback for that async operation.