Hello @luddes,
Welcome to the Google Cloud Community!
Cloud Functions can be triggered by Pub/Sub messages. They allow a configurable timeout Set timeout, with up to 60 minutes for HTTP functions and 9 minutes for event-driven functions. This setup enables the functions to start processing and acknowledge the Pub/Sub message, with the actual processing occurring asynchronously in the background.
Hello @juliadeanne ,
Thank you for the welcome and your explanations about Google Cloud Functions and Pub/Sub.
I was wondering if a similar approach to what you described for Cloud Functions (where the actual processing occurs asynchronously in the background after acknowledging the Pub/Sub message) is also viable and recommended for Google Cloud Run. Specifically, does it make sense to run a separate thread in Cloud Run to start processing data while quickly responding to Pub/Sub with an acknowledgment, to prevent the message from being retried before processing completes?
This method seems to solve the issue of long-running tasks (over 10 minutes), but I would like to know the best practices or potential implications of this approach in a Cloud Run environment.