Threads cannot be opened in the direct, traditional fashion in App Engine, due to runtime sandbox restrictions <https://cloud.google.com/appengine/docs/java/runtime?hl=en>. You can use com.google.appengine.api.ThreadManager <https://cloud.google.com/appengine/docs/java/javadoc/com/google/appengine/api/ThreadManager> to spawn threads. Read the "Threads" section of the first linked doc to see more details. Be aware that they will need to join before the HTTP response is finally sent and the servlet method terminates.
On Friday, January 15, 2016 at 11:30:24 AM UTC-5, Hung Ha wrote: > > Tried to run this code in App Engine but got Permission error > > new java.util.Timer().schedule( > new java.util.TimerTask() { > @Override > public void run() { > // your code here > list.remove("coo"); > } > }, > 3000 > ); > > The above code run periodically every 3 seconds. > > I want to do the same in Google App Engine, but do not know how. I heard > that we can useThreadManager or Runnable or something likes that. > > So, can you give a very simple example of how to run a Thread inside > Google Apple Engine? > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscr...@googlegroups.com. To post to this group, send email to google-appengine@googlegroups.com. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/2361db52-fce4-4c01-8cba-edf8e5e7057a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.