Incremental application programming interface (API) processing based on resource utilization
System and methods are described for receiving a request from a client application to obtain data from a server; collecting a list of tasks to be performed by the server to process the request to obtain the data; performing tasks from the list of tasks by the server until an elapsed time to perform the list of tasks exceeds a first threshold and a size of a payload storing the data exceeds a second threshold; preparing the payload; and sending the payload to the client application.
1. A computer-implemented method comprising:
receiving a request from a client application via a communication interface to obtain data;
determining via one or more processors a list of tasks to be performed to process the request to obtain the data;
determining a data payload by performing tasks from the list of tasks;
determining whether an elapsed time to determine the data payload by performing the tasks from the list of tasks exceeds a first threshold and whether a size of the data payload exceeds a second threshold, wherein performing tasks from the list of tasks comprises publishing one or messages to client applications through a message queue; and
sending the data payload to the client application when it is determined that either the first threshold or the second threshold is exceeded, the data payload including a relay token indicating an amount of the request that has been processed.
2. The computer-implemented method of claim 1 , wherein the relay token indicates to the client application how much of the request has been processed in the partial payload.
3. The computer-implemented method of claim 1 , comprising continually adjusting the first threshold and the second threshold based at least in part on current operating parameters of a server in a cloud computing environment.
4. The computer-implemented method of claim 1 , comprising setting a timer to measure the elapsed time to perform the list of tasks when the request is received.
5. The computer-implemented method of claim 1 , wherein performing tasks from the list of tasks comprises performing one or more read operations to fetch selected data from a database.
6. A tangible, non-transitory computer-readable storage medium having instructions stored thereon which, when executed by a processing device, cause the processing device to:
receive a request from a client application via a communication interface to obtain data;
determine via one or more processors a list of tasks to be performed to process the request to obtain the data;
determine a data payload by performing tasks from the list of tasks;
determine whether an elapsed time to determine the data payload by performing the tasks from the list of tasks exceeds a first threshold and whether a size of the data payload exceeds a second threshold, wherein performing tasks from the list of tasks comprises publishing one or messages to client applications through a message queue; and
and
send the data payload to the client application when it is determined that either the first threshold or the second threshold is exceeded, the data payload including a relay token indicating an amount of the request that has been processed.
7. The tangible, non-transitory computer-readable storage medium of claim 6 , wherein the relay token indicates to the client application how much of the request has been processed in the partial payload.
8. The tangible, non-transitory computer-readable storage medium of claim 6 , comprising instructions to continually adjust the first threshold and the second threshold based at least in part on current operating parameters of a server in a cloud computing environment.
9. The tangible, non-transitory computer-readable storage medium of claim 6 , wherein performing tasks from the list of tasks comprises performing one or more read operations to fetch selected data from a database.
10. A cloud computing system comprising:
one or more servers including a processor and memory configurable to:
receive a request from a client application via a communication interface to obtain data;
determine via one or more processors a list of tasks to be performed to process the request to obtain the data;
determine a data payload by performing tasks from the list of tasks;
determine whether an elapsed time to determine the data payload by performing the tasks from the list of tasks exceeds a first threshold and whether a size of the data payload exceeds a second threshold, wherein performing tasks from the list of tasks comprises publishing one or messages to client applications through a message queue; and
send the data payload to the client application when it is determined that either the first threshold or the second threshold is exceeded, the data payload including a relay token indicating an amount of the request that has been processed.
11. The cloud computing system of claim 10 , wherein the relay token indicates to the client application how much of the request has been processed in the partial payload.
12. The cloud computing system of claim 10 , comprising the server to continually adjust the first threshold and the second threshold based at least in part on current operating parameters of a server in a cloud computing environment.
13. The cloud computing system of claim 10 , wherein the server to perform tasks from the list of tasks comprises the server to perform one or more read operations to fetch selected data from a data base.
14. The cloud computing system of claim 10 , wherein the cloud computing resources comprises at least one of a connection to a database and a connection to a message queue (MQ).