Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82755

Getting iterate updates from the server side Editor code

$
0
0

I have a form where the user will submit an entry and the server side Editor code will do the following steps in a validator:

1) Verify the entry maps to a valid Wikidata id
2) Retrieve some data from the Wikidata api
3) Retrieve some data from the Wikipedia api
4) Retrieve some data from the OpenStreetMap api
5) Perform some calculations with the OpenStreetMap data
6) Continue if all of the above is successful

The time from the submission to the final part usually takes about 3 or 4 seconds, but could take as many as 8 or 10 seconds depending on the response time for those apis.

I know I can throw an error if any of those steps fail, but what about a way to send iterate updates to the user about the progress of each step if it passes?

Such as:

- Found Wikidata ID!

Next:

- Found Wikidata ID!
- Retrieved Wikidata data!

Next:

- Found Wikidata ID!
- Retrieved Wikidata data!
- Retrieved Wikipedia data!

Next:

- Found Wikidata ID!
- Retrieved Wikidata data!
- Retrieved Wikipedia data!
- Awww man -- No OpenStreetMap entry :/

Viewing all articles
Browse latest Browse all 82755

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>