Back

[SOLVED] Functions async

  • 0
  • Functions
develocode777
4 Dec, 2023, 07:50

When I execute a function marked with xasync it doesn't return the result, is this expected? If yes, then how can I get the result?

TL;DR
If you set the xasync parameter to true in your cloud function, it will run in the background and you will not receive the result. If you set it to false, you will wait for the function to finish and return a result. To get the response of the execution, you can use the responseBody property in the Execution Model of appwrite. You can get it by either running the function in sync mode or by using the corresponding API endpoint.
D5
4 Dec, 2023, 10:33

Yes

D5
4 Dec, 2023, 10:33

You can get it by running it in sync mode or by getting the execution with the corresponding API endpoint

Mosh Ontong
4 Dec, 2023, 10:40

if you set the xasync parameter into true, it indicates that you want to run your cloud function in background. Hence, you will not get the result, since it runs in the background.

Otherwise, if you set false, it indicates that you are going to wait until the function process is done. It means, it is expected that the function will returns a result.

how to get the response of the execution? There is properties called responseBody in the Execution Model of appwrite.

develocode777
4 Dec, 2023, 11:03

ok, thanks

D5
4 Dec, 2023, 11:05

[SOLVED] Functions async

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