Open armanbilge opened 2 years ago
I started working on this a bit and it seems that the background functions are (about to become) legacy, in favor of CloudEvents
, which are supposedly designed to be cloud-platform-independent. It seems the Cloud Functions documentation hasn't been updated with this, and it's still not entirely clear to me how to deploy cloud-event-based functions.
In any case, it seems we may want to build our own Functions Framework according to the contract laid out here: https://github.com/GoogleCloudPlatform/functions-framework#functions-framework-contract IMO this is actually a lot more interesting, since it describes something lower-level (i.e., listening on ports rather than being handed pre-digested events) and actually might be portable beyond the Google Cloud Platform. So this gives us a lot more control over how we do things, and makes them much easier to test without requiring to emulate specific cloud environments.
For performance, efficiency and correctness reasons, the framework must be able to handle multiple concurrent invocations of the developer's function.
This is very interesting 🤓
Superseded by https://github.com/typelevel/feral/issues/132.
Well, I suppose this is worth keeping open actually. At the moment I don't think you can deploy a custom Functions Framework to Cloud Functions (you have to buy into one of their frameworks) and Cloud Functions is a different product with a different pricing model etc. than e.g. Cloud Run or another service where you can deploy an custom Functions Framework.
Did some preliminary research, there seem to be: