android - REST best practices and connectivity issues -


I have an interesting issue and should invest something with someone who is with the same experience. I have an Android app that makes a realt call (i.e. accepts open order) sends an app request and continues on issues of connectivity, meanwhile the server gets a request, the order situation changes and a Returns the response (such as HTTP 200). However, the app is missing its network connection, the response does not receive and an expiration exception is received. If I try to accept the order again, then I get the answer that it has already been taken (in this case by me).

The question will be - what should be the best way for such a situation. For now, if I get a timeout exception (in some scenarios it is a loop with another web call to check that the order is not in my "current order" or not) then the loop needs to be run. I need this design Do not like it and wondered what might be better that web calls can return 200 (success) if the same customer tries to accept two or more similar orders? Or how will some of you handle such a situation?

"accept" action.

What does this really do? On one hand it seems that this order state updates. This should be done when nothing should be changed ahead of the update.

On the other hand, you have some kind of external state (order is taken). It can not be done through REST, you have to use some specific ID to resolve the conflict. See it for more information.


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -