I'm trying to figure out if the following is possible in Cloud Code... Lets say I want my user to make an API call that reports a complex set of data. This call will return a sort of heart beat response which will include data on which the user needs to act upon quickly. The data the user originally sent is unrelated to the data in the response. However, the data sent needs to be processed and filtered into some redis based accumulators (a potentially time consuming task).
In my own server systems I would do one of two things:
1. Return a response to the user and then process this data after the user is on their merry way.
2. Encode the data in a second request spawned from the server that gets handled by a server instance that runs specifically for processing cpu heavy tasks (doesn't handle frontend facing requests).
Is there a way to return a response to the user before the completion of a segment of cloud code? Similarly it looks like the SparkHttp will wait for a response before it sends the final response to the user. Is this correct?
Thanks,
Evan
2 people have this question
1 Comment
Customer Support
said
about 7 years ago
Hi Evan,
Can you break this down a little into exactly what you are trying to achieve in the game?
Evan Gilbert
Hey everyone,
I'm trying to figure out if the following is possible in Cloud Code... Lets say I want my user to make an API call that reports a complex set of data. This call will return a sort of heart beat response which will include data on which the user needs to act upon quickly. The data the user originally sent is unrelated to the data in the response. However, the data sent needs to be processed and filtered into some redis based accumulators (a potentially time consuming task).
In my own server systems I would do one of two things:
1. Return a response to the user and then process this data after the user is on their merry way.
2. Encode the data in a second request spawned from the server that gets handled by a server instance that runs specifically for processing cpu heavy tasks (doesn't handle frontend facing requests).
Is there a way to return a response to the user before the completion of a segment of cloud code? Similarly it looks like the SparkHttp will wait for a response before it sends the final response to the user. Is this correct?
Thanks,
Evan
2 people have this question