Konstantin Konopko
Konstantin Konopko

Reputation: 5418

Firebase functions: sequence of calls

Does Firebase proceed async calls in series or not?

I have two calls as mentioned below. Is it possible that 2nd call going to finish early than 1st one?

var p1 = admin.database().ref(path1).set(value1);
var p2 = admin.database().ref(path2).set(value2);

return Promise.all([p1, p2]);

Upvotes: 0

Views: 88

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317372

For Realtime Database, no, it is not possible for the case you've shown. The operations will complete in the order they were executed.

Upvotes: 1

Related Questions