user93796
user93796

Reputation: 18379

Threads/backend in appengine java

I want to run some kind of Thread continuously in app engine. What the thread does is checks a hashmap and updates entries as per some business continuously.

My hashmap is a public memeber variable of class X. And X is a singleton class.

Now I know that appengine do not support Thread and it has somethinking called backend.

Now my question is: If I run backend continiously for 24*7 will I be charged? There is no heavy processing in backend. It just updates a hashmap based on some condition. Can I apply some trick so that am not charged? My webapp is not for commercial use and is for fun.

Upvotes: 0

Views: 395

Answers (2)

Walter
Walter

Reputation: 51

Or you can too enqueue a 10 minutes task and re-enqueue when is near to arrive to its 10 minutes limit time. For that you can use the task parameters to pass the state of the process to the next task or also you can use datastore.

Upvotes: 0

Peter Knego
Peter Knego

Reputation: 80330

Yes, backends are billed per hour. It does not matter how much they are used: https://developers.google.com/appengine/docs/billing#Billable_Resource_Unit_Costs

Do you need this calculation to happen immediatelly? You could run a cron job, say ever 5 min and perform the task.

Upvotes: 1

Related Questions