Home How to make asynchronous ajax requests if the server side work takes plenty of time to finish?
Reply: 0

How to make asynchronous ajax requests if the server side work takes plenty of time to finish?

chasank
1#
chasank Published in 2018-02-12 15:36:59Z

I need advice or sample code to achieve a task related asynchronous ajax request that server side work takes plenty of time to finish its job.

Here is the sample scenario;

I've a simple CSV file upload form. User submits file

  • Server starts processing CSV file.
  • Server makes queries to external web apis for each line of CSV file. (additional network request/response delays)
  • Server parses each response (regex calculations, additional delays) and stores data into database.
  • Server produces another output CSV file.

If the CSV file contains < 100 rows, it works even without using ajax. However I need to make it asynchronous to be able to feed a lot of rows. The critical part is I don't want to have timeouts as long as server side code is working. I want to be able to update client side regularly about the progress of work (log-like update, for example "x record is saved into database")

Can you provide me a working dummy sample code (for example, calculating fibonacci numbers) both client side and server side. (if possible django)

Thanks.

Kind Regards.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.295156 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO