![](https://cdn.discordapp.com/avatars/1090718308409557013/02a332a8f2f511878a8c5795910b3baa.webp)
I had a function that made 3 requests to the OpenAI API with 3 different prompts. This function took more than 30 seconds to respond and gave a timeout. So I divided it into 3 functions, each one making a request to the OpenAI API in parallel. However, they still took more than 30 seconds to respond.
@Steven suggested that they be run asynchronously, but this is creating a queue of executions. While one is processed, the other two are waiting.
Is it possible to execute a function asynchronously but without a queue being created?
![](https://cdn.discordapp.com/avatars/462046107556511744/504fd808296728e8e89d82b8ea1e77a9.webp)
No. Perhaps you need to horizontally scale out your function workers
![](https://cdn.discordapp.com/avatars/1090718308409557013/02a332a8f2f511878a8c5795910b3baa.webp)
You are saying that if i execute it sync, making 3 requests to 3 different functions, it runs in parallel. But making the same 3 requests with async option, it creates a queue, and the only way to avoid it is scaling out?
Recommended threads
- Hello everyone, I am getting Type: Utopi...
Hi, we are running appwrite 1.3.7 but sometimes we are getting error like Type: Utopia\Exception [Error] Message: Not Found [Error] File: /usr/src/code/vendor/u...
- Hello everyone I'm getting this error, a...
Hello everyone I'm getting this error, any documentation out for it?
- OAuth2 with SwiftUI fails to save cookie
Hi everyone, I'm trying to integrate OAuth2 with the SDK for Apple. Everything works as expected, but somehow the session is not passed on to the app. When ex...
![](/images/bgs/pre-footer.png)