I'm new to Firebase and trying to set up a task queue. My objective is to read requests with a 'pending' status from a datastore queue, send an HTTP request to an external third-party server, and then update the request status to 'ready'. The external server has a response time of around 5-10 seconds and does not support parallel calls, so I have to ensure that only one request is being processed at a time.
I tried the following approaches:
Triggered Function: I attempted to trigger a Cloud Function when a new record is added to the queue repository. I expected this to work, but it led to parallel processing, which is not supported by the external server.
Scheduled Job: Another option I considered was running a scheduled job. However, Firebase's minimum scheduling time is one minute, which is too long for my use case where each request takes 5-10 seconds to process.
Cloud Tasks: I also looked into Cloud Tasks, but I don't see how it would be applicable since I'm dealing with an external third-party service.
I was expecting to find a method to process each request one at a time while adhering to the timing requirements.