views:

51

answers:

1

I am having a a method which listens continuously to a stream from a server and writes that data to datastore in google app which is later on retrieved by other methods. How can i do that in google app engine i.e calling that method one time during the starting of app and having it running for unlimited time without affecting other things. I am new to java world,So please help from that point of view also.How's that done in Java?

+2  A: 

Specific for the google app engine you would use a task. However, on google app engine tasks are limited to 30 seconds execution time or anything that runs on appengine, like a http request. This means you are limited in running long running tasks. See: http://code.google.com/appengine/docs/java/taskqueue/overview.html

Hilbrand
Can you schedule many end-to-end short running tasks which can give the same result?
Thorbjørn Ravn Andersen
I think it's possible. If your task's execution nears the 30 second limit, App Engine will raise an exception which you may catch and then add a new task to the task queue. Tasks are executed in a queue so there might be some time between execution of 2 tasks.
Hilbrand