Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7736733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:49:01+00:00 2026-06-01T07:49:01+00:00

I have Spatial Selection implemented on Map in my Web Application, which selects the

  • 0

I have “Spatial Selection” implemented on Map in my Web Application, which selects the number of Streets. After Selection, I get unique street Id for all the Streets which are selected using “Selection Handler”.

My next step is to send Ajax request to Server per Street Id and get back the response. Currently, I am doing this using only single For Loop and sending Ajax request for Each Street Id as follows.

for (var index in streetIds) {
    sendAjaxRequest(streetIds[index]);
}

function sendAjaxRequest(streetId) {
  $.ajax({
      type : 'POST',
      url :  OpenLayers.ProxyHost + this.url,
      data : streetId,
      success : function(response) {
          sos.parseSOSObservations(response);
      },
      error : function(x, e) {
          alert("Something went wrong in the request" + e);
      }
  });
}

For Example: If user has selected 1000 streets over map, then my program will send 1000 post request which will obviously slow down my application and block the browser.

Can any one please suggest, How can I handle multiple concurrent number of Ajax request in this case along considering the performance of Web Application?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:49:03+00:00Added an answer on June 1, 2026 at 7:49 am

    Each request is async so it is pretty fast to make a bunch of requests like that, but it doesn’t scale too well. Each time a request is made some overhead processes wrap each request. Its very very small, so a few dozen requests its not so bad, when its a thousand requests, times a hundred users (or worse), you begin to have problems.

    If you decide to proceed this direction its easy enough to convert it later to one request if you plan ahead. Build a business delegate so that it takes a list and calls the callback once it has all the responses. Something like

    MyWS = new MyWS(); // MyWS = your web service class
    function getList(list,callback){
        var results = _.map(list,function(value,key){
            MyWS.getStreetDetail(value,function(response){
                console.log(response) // {data:{name:"LoveTree Way"...}}
                results[key] = response.data;
                check();
            });
        });
        function check(){
            if(_.all(results,function(value){return !!value;}))
                callback(results);
        }
    }
    list = [268,320,380];
    getList(list,function(results){
        alert("results",results.toSource())
    });
    

    Of course I would build the getList function right into your delegate so you can just forget about it.

    new MyWS().getList([268,320,380],function(data){
        console.log("data",data)
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a n-tire web application and search often times out after 30 secs. How
I have spatial data - (x, y) points on a plane - which I'm
I have a PostgreSQL\PostGIS spatial database which contains Hebrew text columns. The system runs
I have a spatial model definition which used to be working with SQL Server
I have a view which already has SchemaBinding applied AND it has a UNIQUE
I have created a Silverlight project which also contains a Web project. I have
I have a number of files containing vast amounts of Insert statements (which were
I have two geo-spatial simple convex polygon areas, in latitudes and longitudes (decimal degrees)
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.