smiley/steamapi

Multiple API calls should be done at the same time

smiley opened this issue · 2 comments

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.

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.

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