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 7194233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:19:48+00:00 2026-05-28T20:19:48+00:00

I use the google app engine to run certain projects of mine. Because of

  • 0

I use the google app engine to run certain projects of mine. Because of the 30 second time limit that it imposes on requests, I use cursors and memcache to throttle the data fetch process.

Problem statement:

  1. I have an ajax call log which is basically a list of all the details I need from the server, created by some user interaction
  2. Each ajax call in the call log may have data, that may cause the 30 second limit to hit. So I need to break it down and return it in parts.
  3. Once all the calls in the log have been completed, I need to perform some custom logic, based on the return data.

Now, I already have a solution that works in this way:

  1. Initiate the first ajax call with some random identifier
  2. On return, check some parameter to identify whether all the required data has been acquired.
  3. If not, then perform the call again, with the same random identifier as in step 1 + save whatever data has been fetched so far
  4. If yes, remove the item from log and repeat steps for next item

But all of this code is currently being handled in the success event of the ajax call. I read about jQuery Deferreds and it seems like a really good candidate to fix the atrocious code that is currently being employed.

I’ve already figured out the following:

  1. Use $.when.apply(null, arrayOfDeferreds) to create a dynamic call list of sorts – read jQuery.when
  2. I can now use the the deferred.done function to save a data dump for each call
    The problem being, how do I tell the deferred that if the request needs to be called again, then don’t resolve the ajax request – just save my data and perform the call again with the same random identifier as its initial call? That is, basically calling my done function repeatedly until all the data is saved ? If there is a better way to do this, please provide an explanation.
  • 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-05-28T20:19:48+00:00Added an answer on May 28, 2026 at 8:19 pm

    You can use pipe recursively as follows:

    function myFetch( id ) {
        return $.ajax({
            url: serviceURL,
            data: {
                id: id,
                someOthers: data
            }
        }).pipe(function( data ) {
            saveData( data );
            if ( !isOK( data ) ) {
                return myFetch( id );
            }
        });
    }
    

    The ajax request is only defined once and you conditionaly re-issue it in the pipe handler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Applications that run inside the Google App Engine can use Google Accounts for user
I just started working on a project that will run on google app engine
i use Quercus to run php on google app engine and and i use
I'm trying to learn how to use the google app engine because I want
I'm developing a iPhone application that will use a Google App Engine backend and
I have started to write app that can run on Google App Engine. But
Tried following the instructions here: How to use Google app engine with my own
On Google App Engine to query the data store with Python, one can use
When using Google app engine is there any benefit to use a CDN if
after launching your app on google app engine. you can use the 'logs' page

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.