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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:39:50+00:00 2026-06-16T14:39:50+00:00

I want to collect some statistical data which needs some time to process, but

  • 0

I want to collect some statistical data which needs some time to process, but it is not going affect user content which is returning. I am currently doing it by first caching, then processing it with a cron job.

Is there any way to do this job immediately after returning user content?

It should be like:

def post(self):
    self.response.out.write("some output")
    # here user should not wait any more output
    # loading should be end in user browser.

    collectSomeStatistics(self)

(I am using Python 2.7)

  • 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-16T14:39:52+00:00Added an answer on June 16, 2026 at 2:39 pm

    You can use the deferred library

    from google.appengine.ext import deferred
    
    def do_something_expensive(a, b, c=None):
      logging.info("Doing something expensive!")
      # Do your work here
    
    # Somewhere else
    deferred.defer(do_something_expensive, "Hello, world!", 42, c=True)
    

    So your code becomes:

    def post(self):
      deferred.defer(collectSomeStatistics,args)
      self.response.out.write("some output")
    

    This then executes your function as a separate task, and the call to deferred returns immediately. Of course you won’t be able to include any results from that deferred function in the content you return to the user.

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

Sidebar

Related Questions

I want to collect some data from the front page of a website. I
I have created a module that i want to collect some simple data in
I want to collect data which is classified in many groups. When I receive
I have a program in which I collect some data and store them temporarily
I want to collect some useful & common animatios in ios. Is there any
I want my C# program to collect data. Then, when the OK button is
I want to use Flurry to collect some statistics, so I registered and created
I have an xml sheet with some data and some images that i want
I am developing a site with Drupal 7. I collect some data from visitors
Is it possible to collect data for IntelliTrace only for some code area? E.g.,

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.