Running cloud code after response is sent to client
L
Laura Puerto
started a topic
almost 6 years ago
I was wondering if it is possible to run additional logic (i.e. make an external http request) from cloud code AFTER a cloud code response is sent to the user. I want to add an http request to some cloud code but I don't want to introduce latency to the request since this http request has nothing to do with the actual response to the client.
I am not sure if something like a worker thread is supported via cloud code.
Thank you!
Best Answer
C
Customer Support
said
almost 6 years ago
Hi Laura
Is the event a custom log event request or a built in GameSparks request?
It is possible to put cloud code in the response but It would be run before the response is sent to the user.
If it has to be sent after the response is sent to the user,Then you would need to create a custom event that is called after the response is retrieved.
Is the event a custom log event request or a built in GameSparks request?
It is possible to put cloud code in the response but It would be run before the response is sent to the user.
If it has to be sent after the response is sent to the user,Then you would need to create a custom event that is called after the response is retrieved.
Laura Puerto
I was wondering if it is possible to run additional logic (i.e. make an external http request) from cloud code AFTER a cloud code response is sent to the user. I want to add an http request to some cloud code but I don't want to introduce latency to the request since this http request has nothing to do with the actual response to the client.
I am not sure if something like a worker thread is supported via cloud code.
Thank you!
Hi Laura
Is the event a custom log event request or a built in GameSparks request?
It is possible to put cloud code in the response but It would be run before the response is sent to the user.
If it has to be sent after the response is sent to the user,Then you would need to create a custom event that is called after the response is retrieved.
Regards
Katie
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstChristian Gauthier
Hi Laura,
You can use Spark.getScheduler() to do that, here's the documentation
https://docs2.gamesparks.com/tutorials/cloud-code-and-the-test-harness/scheduling-cloud-code.html
Customer Support
Hi Laura
Is the event a custom log event request or a built in GameSparks request?
It is possible to put cloud code in the response but It would be run before the response is sent to the user.
If it has to be sent after the response is sent to the user,Then you would need to create a custom event that is called after the response is retrieved.
Regards
Katie
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics