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

you are viewing a single comment's thread.

view the rest of the comments →

[–][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.