Answer the question
In order to leave comments, you need to log in
What are the practices for dealing with asynchronous response from services?
Several times I have come across situations where services are able to send results only through callbacks.
In one case, these were responses from a bank after making a payment through their web form. At first, I solved the problem by stupidly cyclical checking through ajax for the received response. Then it seems like they made a half-measure from the point of view of security, and due to the specifics of the product (offline services with a long time interval after payment), this was acceptable.
Now a similar problem arose when working with the advertising service in mobile games. We have seen everything like this before: you watch a video and get in-game currency. The service also works asynchronously and sends a callback response with a delay of 1 second to 5 minutes. But no one will make the user wait so long, will they? What is the best way to solve the problem in such cases? Only by accruing "advance" at the time of sending the team to show the video?
Potentially, you can wind up a lot of game currency if you intercept requests and then send them with curl. And spend before sync happens.
Are there other practices?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question