Back

[CLOSED] Functions CreateExecution ASYNC flag does what exactly ?

  • 0
  • Self Hosted
  • Functions
punti_z
9 Dec, 2023, 20:39

From the documentation its not clear since documentation mentions ASYNC boolean is set to false by default and also says "Once endpoint is called, your function execution process will start asynchronously"

What does it do and how does it work if I want my functions to run asynchronously ?

TL;DR
The user is asking for clarification on the ASYNC flag in the CreateExecution function. They mention that setting it to false causes function failures. The user wants to know what happens if an instance of the function is already running and how to handle immediate execution. Another user responds that synchronous executions run concurrently. The user confirms their understanding that setting ASYNC to false starts the function execution immediately. Another user explains that asynchronous execution means the function is queued and executed later, so the response will show a status of waiting and no logs or errors. The documentation is unclear on this. Solution: The ASYNC flag in CreateExecution determines whether the function
Drake
9 Dec, 2023, 22:03

An asynchronous execution means it's not executed right away. It gets queued and executed later. This means the response of create execution will have a status of waiting and no response/logs/error

punti_z
9 Dec, 2023, 22:33

So that means if I need the function to start execution immediately I mark ASYNC in createExecutiom as false .. Is that accurate ?

punti_z
9 Dec, 2023, 22:34

Ok and if an instance of that function is already running then ?

I receive multiple user sign ups and each triggers the same function that runs say for 5 secs. How would a call for immediate execution be handled

Drake
9 Dec, 2023, 22:38

Synchronous executions run concurrently

punti_z
9 Dec, 2023, 22:39

Nice. Testing it right now. Will mark this as solved right after

punti_z
11 Dec, 2023, 16:00

Turning it to false causes a lot of function failures. I'll mark it solved since at least I understand how its meant to function. Will open another thread if I need help.

punti_z
11 Dec, 2023, 16:00

[CLOSED] Functions CreateExecution ASYNC flag does what exactly ?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more