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

  • Home
  • SEARCH
  • 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 7857691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:07:00+00:00 2026-06-02T21:07:00+00:00

Since Appengine won’t allow java multithreading, how then can we migrate our existing multithreaded

  • 0

Since Appengine won’t allow java multithreading, how then can we migrate our existing multithreaded code to the platform?

For example I have the following code:

    Thread t = new Thread() {
        public boolean alive = true;
        public void run() {
            while (alive) {
                try {
                    Thread.sleep(5000);    
                    getNewNotifications();
                } catch (InterruptedException e) {
                    //  Do nothing
                } catch (IOException e) {
                } 
            }
        }
    };
    t.start()

The function getNewNotification() does some several Rest/HTTP calls, that may include some other process that may return indefinitely. I have read the Task Queue is the solution, however how do we convert this simple code into App engine-friendly code?

How is the code above implemented using Task queue? For example to call getNewNotifications() for every five seconds.

And that function will get some results from the server, parse the result and then execute the activities/work it needs to do based on the result.

  • 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-02T21:07:03+00:00Added an answer on June 2, 2026 at 9:07 pm

    Depending on your budget (check billing for backends), you can achieve this also by using Scheduled Tasks.

    You would specify the task in the cron.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <cronentries>
      <cron>
        <url>/getNewNotifications</url>
        <description>Get new notifications every 5 minutes</description>
        <schedule>every 5 minutes</schedule>
      </cron>
    </cronentries>
    

    Of course, you need to have a servlet (or whatever framework you are using) mapped to the URL /getNewNotifications.

    You should also make sure, that the URL is secure (normally you don’t want your users call that URL).

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

Sidebar

Related Questions

There's an error message I can't understand since I don't see where my code
I am working on web application and using GAE/J blobstore tutorial http://code.google.com/appengine/docs/java/blobstore/overview.html I was
I am working in Eclipse on a Google AppEngine Java code. Every time I
since IE won't render XHTML as XHTML, but treat it as HTML instead, when
This code is used in Learn You A Haskell to explain how (++) can
I recently upgraded my GAE Python app to Python 2.7. Since then, I periodically
I'm writing a RESTful webservice for Google AppEngine. The webservice provides a Java serialized
Can I write to the memcache from Go and read it from Java (on
I started developing my application in AppEngine Java, however I noticed that Facebook has
Since Google App Engine is a PaaS does it use any hypervisor? it is

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.