Is your feature request related to a problem? Please describe.
Concurrency sometimes is important...
E-Com Plus and integrated solutions webhooks may occur almost at the same time, and it comes with some problems to process status changes and other flows.
Also, we like to be fast and cold starts are not cool 😛
Describe the solution you'd like
Our upcoming version of Cloud Functions uses Cloud Run as its underlying infrastructure. You'll see fewer cold starts because each function instance will now be able to handle 80 concurrent requests by default, as opposed to the current Cloud Functions for Firebase limit of 1.
With Cloud Functions 2nd gen we can enable concurrency, then receive many webhooks at the same execution to be able to control with easy "duplicated" webhooks:
const handlingIds = [];
if (!handlingIds.includes(resourceId)) {
handlingIds.push(resourceId)
/* await do stuff */
const handlingIndex = handlingIds.indexOf(resourceId)
handlingIds.splice(handlingIndex, -1)
}
// skip handling current webhook if same resource id already being treated
Additional context
Cloud Run seems to be the best of both Worlds, but we can deal with Firebase Alpha (private) features? It is still very important that partners can use this starter template with easy.
Is your feature request related to a problem? Please describe. Concurrency sometimes is important... E-Com Plus and integrated solutions webhooks may occur almost at the same time, and it comes with some problems to process status changes and other flows. Also, we like to be fast and cold starts are not cool 😛
Describe the solution you'd like
With Cloud Functions 2nd gen we can enable concurrency, then receive many webhooks at the same execution to be able to control with easy "duplicated" webhooks:
Describe alternatives you've considered https://github.com/ecomplus/application-starter/issues/137
Additional context Cloud Run seems to be the best of both Worlds, but we can deal with Firebase Alpha (private) features? It is still very important that partners can use this starter template with easy.
Update: public beta