3 ms·
I'm not sure this is actually the case, Cloud Functions instances might be handling one request at a time, but they call also share a global scope, as you can s
by reaktivo 8y ago
I'm not sure this is actually the case, Cloud Functions instances might be handling one request at a time, but they call also share a global scope, as you can see in their Tips & Tricks document[1]
[1] https://cloud.google.com/functions/docs/bestpractices/tips#use_global_variables_to_reuse_objects_in_future_invocations https://cloud.google.com/functions/docs/bestpractices/tips#u...
- hn_throwaway_99 8y agoNo, what I meant was that it is safe to keep request-scoped data in global scope without needing to worry that a concurrently running request will interfere with the state there. Normally in a Node server you cannot do this. Cloud Functions will reuse instances for subsequent invocations (that's what "being warm" means), but separate instances do not share global scope.