Suman Mondal
Suman Mondal

Reputation: 47

Is there a way to dispatch a task only after the previous task is completed, while using google cloud tasks?

I am trying to build a realtime bid matching engine, where the bid matching logic resides inside a firebase cloud function, and i want the cloud function to have only one instance running at any point of time to prevent data contentions condition.

The idea is that for for every new bid, i create a new google cloud task, but at the same time the new task should be dispatched, only when the the previous task is completed.

Regards Suman

Upvotes: 1

Views: 870

Answers (1)

guillaume blaquiere
guillaume blaquiere

Reputation: 75790

You can use the Cloud Task rate limit feature on your task queue. Set it to 1 to dispatch only one task at a time.

Upvotes: 1

Related Questions