Simulating synchronous execution of asynchronous operations
AssigneeGoogle Technology Holdings LLC
InventorWolfram Kriesing
Life of this patent
Estimating the term…
Abstract
A computer-implemented method is presented here. The method obtains a script to be executed, wherein the script includes instructions for an asynchronous operation, and wherein the asynchronous operation includes a request calling for a result. The method continues by performing a provisional iteration of the script, wherein the provisional iteration of the script is associated with at least a portion of the script, and wherein the provisional iteration of the script obtains and saves the result as a cached result. Thereafter, a final iteration of the script is performed using the cached result.
Claims20
A computer-implemented method comprising:
- obtaining a script to be executed, the script comprising instructions for a plurality of asynchronous operations, wherein each asynchronous operation includes a request calling for a result;
- performing a plurality of provisional iterations of the script, wherein each provisional iteration of the script comprises performing at least one of the plurality of asynchronous operations, obtaining a result for the at least one of the plurality of asynchronous operations, and caching the result in a storage device;
- determining whether results for each of the plurality of asynchronous operations has been cached in the storage device;
- and
- in response to determining that the results for each of the plurality of asynchronous operations has been stored in the storage device, performing a final iteration of the script using the cached results stored in the storage device.
A non-transitory computer-readable storage medium with executable instructions stored thereon, wherein the executable instructions instruct a processor to manage a script having a plurality of asynchronous operations including at least a first asynchronous operation and a second asynchronous operation, wherein each of the asynchronous operations calls for a corresponding result such that completion of the script is associated with a plurality of results, and wherein the executable instructions instruct the processor to perform a method comprising:
- performing a first provisional iteration of the script to execute the first asynchronous operation and issue a first request calling for a first result;
- terminating execution of the first provisional iteration of the script;
- receiving the first result in response to issuing the first request;
- caching the received first result to obtain a cached first result;
- thereafter, performing a second provisional iteration of the script, wherein the second provisional iteration of the script uses the cached first result, executes the second asynchronous operation, and issues a second request for a second result;
- terminating execution of the second provisional iteration of the script;
- receiving the second result in response to issuing the second request;
- caching the received second result to obtain a cached second result;
- and
- thereafter, performing a final iteration of the script using the cached first result and the cached second result.
A computer-implemented method of simulating synchronous execution of asynchronous operations, the method comprising:
- obtaining an executable script comprising sequential operations beginning with an initial operation and including at least a first asynchronous operation and a second asynchronous operation;
- performing a first provisional iteration of the script to execute at least some of the sequential operations, beginning with the initial operation and continuing until execution of the first asynchronous operation;
- terminating the first provisional iteration of the script in response to execution of the first asynchronous operation;
- caching a first result generated in response to execution of the first asynchronous operation;
- thereafter, performing a second provisional iteration of the script to execute at least some of the sequential operations, beginning with the initial operation and continuing until execution of the second asynchronous operation;
- terminating the second provisional iteration of the script in response to execution of the second asynchronous operation;
- and
- caching a second result generated in response to execution of the second asynchronous operation.
Dependencies are inferred from the claim text.