smiley / steamapi

An unofficial object-oriented Python library for accessing the Steam Web API.
MIT License
455 stars 105 forks source link

Multiple API calls should be done at the same time #3

Open smiley opened 10 years ago

smiley commented 10 years ago

APIs like SteamApp(...).achievements are becoming expensive with more and more functionality split into different API functions. ".achievements" requires 2 API calls if the game isn't user-associated (=1-2 seconds) or 3 API calls if the game is associated (=2-3 seconds).

While production servers might not experience much due to having a superb connection (each API call will probably amount to <60msec rather than the 310+ msec I'm experiencing), semi-asynchronous, "combined" calls should be looked into.

The easiest solution would be to just call these APIs synchronously, but all at the same time, then wait on all as a group. Another possible solution would be to use lazy-initialized proxy objects to these responses and just keep going, causing in a non-blocking flow until the data is absolutely necessary.

smiley commented 10 years ago

This is proving to be quite an issue. While Requests natively supports asynchronous requests, it requires gevent, which just isn't easy to install and use on Windows, at least on Python x64.

djmattyg007 commented 9 years ago

Couldn't you just say "currently we don't support asynchronous requests on windows"?