babelshift/SteamWebAPI2

Web responses async

dFxed opened this issue · 3 comments

dFxed commented

Hi,

The methods (eg GetPlayerSummariesAsync) are all async.
Actually, if you do multiple requests at time (6 in my case), steam's server returns error 500.
So to get my code work properly I have to sequence async procédures. And this sequencing feels very slow.

Could you think about implementing a stack or queue of requests ? This way this could be slightly faster, I hope.

Kind regards,
dFx

Tvde1 commented

I don't think you know what async really is. You can await said methods and they will never send a request before the former is finished.

Also, a 500 error code means Internal Server Error. That's not a ratelimit or anything.

dFxed commented

It should not, but in this case it is. you can get some clues about "steam api error 500" on google.
For exemple, this error is returned when you are marked as spammer(temporary).

About async, I may be wrong in my doings, but I want my requests to be processed as fast as possible because it is at match start. Players got 20s to buy and view players stats. And as it is start, players data is not available before.
Awaiting each response data to be fecthed before I send a new request, that is an issue for me.

Anyway, some ideas ?

@dFxed, I'm not aware of any limit to the number of simultaneous requests that you can submit. According to the API Terms of Service, there is a daily limit of 100,000 calls. I haven't found official documentation of any other type of limiting.

As for the async methods, it's really up to you and your application to determine how you want to use them. Just because the API has async methods does not mean that you have to execute them in parallel. As @Tvde1 has mentioned, using await will register a callback for your method continue after the async method completes. This allows for other parts of your application to continue while your services are fetching data.

Let me know if you have other questions. For now, there's nothing I can do except give advice on how to consume these APIs from your use cases.