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

706 Views Asked by At

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

1

There are 1 best solutions below

2
guillaume blaquiere On

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.