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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:34:36+00:00 2026-05-14T22:34:36+00:00

I have a web app that I would like to have the following functionality:

  • 0

I have a web app that I would like to have the following functionality:

  1. user gives a url
  2. webapp gets json data from that url and others from same website (this can take anywhere from 1-10 seconds)
  3. webapp uses data to generate page for user

With this approach, I believe that if the server is in the process of getting the data for one user, then the other user won’t be able to load the page (server busy). I would like to avoid this if possible.

It seems like the Google Tasks API would be useful for this, but I don’t see how I can run the task, and then use the output of the task to generate the page (how would the main app know when the task was finished?)

What is the best way to resolve this?

Thanks in advance

  • 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-14T22:34:37+00:00Added an answer on May 14, 2026 at 10:34 pm

    Some ideas:

    1) App engine can serve more than one request at a time. Try it out – app engine will probably spin up more than one instance of your app => multiple requests can be done at once. With request times so long though, I wouldn’t expect it to scale much though (they recommend request/response time in under 1 second – see this link).

    2) If you wanted to return quickly to the user, you could enqueue to the task queue as you suggested. Then have the user’s webpage (via meta tag http-equiv or JavaScript perhaps) poll the server every couple seconds to see if the page is ready.

    3) If the generated page may be needed again, you should consider memcaching it to try to save the effort of generating it again. With load times of 10 seconds, you might even consider storing them in the datastore for a little while (if caching is appropriate for your app).

    Here’s a very basic example of how you might do this:

    import hashlib
    
    from google.appengine.api.labs import taskqueue
    from google.appengine.ext import db, webapp
    from google.appengine.ext.webapp.util import run_wsgi_app
    
    class BuiltPage(db.Model):
        html = db.TextProperty()
    
    class PageBuilder(webapp.RequestHandler):
        """Handler called by the task queue to build the page."""
        def post(self):
            key = self.request.get('key')
            url = self.request.get('url')
            import time
            time.sleep(5) # pretend it takes a while to build the page
            html = "you asked for %s" % url # do real stuff to build the page here ...
            BuiltPage(key_name=key, html=html).put() # should check for errors ...
    
    def html_to_redir_to_built_page(hexkey):
        "Page to show while we wait.  Auto-refreshes until we get the built page."""
        new_url = '/get_built_page?k=' + hexkey
        refresh_tag = '<meta http-equiv="refresh" content="2;%s"/>' % new_url
        return '<html><head>%s</head><body>please wait</body></html>' % refresh_tag
    
    class BuildPageForURL(webapp.RequestHandler):
        """Handles requests by a user to build the page for the request URL."""
        def get(self):
            url = self.request.get('url')
            key = hashlib.md5(url).hexdigest()
            # optimization: check datastore to see if it was already generated?
            taskqueue.add(url='/buildit', params=dict(key=key, url=url))
            self.redirect('/get_built_page?k=' + key)
    
    class GetBuiltPage(webapp.RequestHandler):
        """Returns the built page if it is ready, otherwise returns a page which will retry later"""
        def get(self):
            key = self.request.get('k')
            bp = BuiltPage.get_by_key_name(key)
            if bp:
                self.response.out.write(bp.html)
                # maybe cleanup if you know this is a 1-time request: bp.delete()
            else:
                self.response.out.write(html_to_redir_to_built_page(key))
    
    application = webapp.WSGIApplication([('/',               BuildPageForURL),
                                          ('/buildit',        PageBuilder),
                                          ('/get_built_page', GetBuiltPage)])
    def main(): run_wsgi_app(application)
    if __name__ == '__main__': main()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to design a web app that allows me to sort, browse,
I would like to confirm that the following analysis is correct: I am building
I'm building an app that authors would (hopefully) use to help them, uh.. author
The requirements for this web app include the following: 1- Need to interact with
I would really like to know about support for the following in Erlang. Support
.NET 3.5, C# I have a web app with a search feature. Some of
I have a web service in which I am manipulating POST and GET methods
Currently I am evaluating number of web service frameworks in Java. I need web
Let me explain my problem, and hopefully someone can offer some good advice. I

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.