MehdiS
MehdiS

Reputation: 89

firebase call/trigger functions run like transaction (one after another)

What I want is simple and easy, but I don't know if it is possible to do it.

Func 1:

exports.readProducts = functions.https.onRequest(async (req, res) => {
    //SOME CODE
});

Func 2:

exports.onCountChange=functions.database.ref('/ANALYTICS/count').onWrite((change, context) => {
    //SOME CODE
});

I want this 2 functions to run like transaction, so if 2 people call/change the value at the same time, it should run one call at the time.

Upvotes: 0

Views: 112

Answers (1)

Andres Fiesco Casasola
Andres Fiesco Casasola

Reputation: 801

As mentioned by @Doug Stevenson, it is impossible to make the cloud functions invocations happen in sequence or block another.

Additionally, here is a Google group that you can use for anything related to firebase.

Upvotes: 2

Related Questions