I’ve been using the forum quite intensively lately… Thanks to everyone who helped me or are sharing their knowledge with everyone. I wish I could be more useful here…
I’ve got a Web app that receives photos and other data from an IOS app. The IOS app posts data to the Web App through a JSON HTTP post for both pictures and text. It works fine but… when the POST takes long (more that 2 pictures (500k each)), the app finishes sending and stops waiting before the data is handled by the server. I have no proof of that since I did not build the app but that’s what my guess… So it shows an error warning as a response while everything went fine.
I would like to respond to the app as soon as the “Entity” is received without stopping the processing of the POST content. How should I proceed?
I had to figure out a solution as fast as possible so and got a solution that, even far from being perfect, works well.
I finally splitted the app in two.
One app receives the JSON post stores it in a “intermediary database” and sends a response to the sender IOS app. The user receives a confirmation about his infos being stored into the database.
The second app uses a timer to check if any new entry has to be parsed to the the “final database”.
That would seem to indicate that the problem is not in the transmission of the data, but that processing that data in your web app takes too long. The steps are
Receive the data
Process the data
Send a response
When you change it to
Receive the data
Send a response
Process the data
All goes well. Is that right? If so, you should be able to decouple processing the data from transmission by using a thread or a timer.
The thread way should be good. I’m still worried about not having any feedback from the the data processing… The user will be informed that the info he sent is stored in the database but what about if the processing goes wrong? Is it possible to monitor problems that can occur in the “data processor”? I’m sure it is… I should have asked how…
The thread way should be good. I’m still worried about not having any feedback from the the data processing… The user will be informed that the info he sent is stored in the database but what about if the processing goes wrong? Is it possible to monitor problems that can occur in the “data processor”? I’m sure it is… I should have asked how…
Thanks![/quote]
Typically what an API would do is return a status of 201 CREATED and provide another url that the caller could query for the status of the long running operation.