Patent ID: 8849753
Filing Date: 2014-09-30
Classification: G06F

Abstract:
1. A computer storage memory having computer-executable instructions for causing a computer to perform steps comprising: in a single threaded environment, receiving metadata in a call from a calling function to the original function, the metadata indicating whether calls to a data retrieving function are to be made synchronously or asynchronously by the original function; in a single threaded environment, automatically generating a wrapper around an original function, wherein the wrapper is generated dynamically at runtime and generated only when the metadata indicates calls to the data retrieving function are to be made asynchronously by the original function; and in the single threaded environment, when metadata indicates that the wrapper should be utilized for asynchronous retrieval of data, then utilizing the wrapper around the original function to call the data retrieving function asynchronously, wherein the step of utilizing the wrapper around the original function to call the data retrieving function asynchronously comprises the steps of: initiating an asynchronous retrieval of data from the data retrieving function using a direct callback function; after initiating the asynchronous retrieval of data, throwing a specially marked exception from the data retrieving function to cause control to leave the data retrieving function and the original function and get caught by a special exception in the wrapper; when the direct callback function is called because the data has been retrieved, saving the data from the direct callback function, and calling the wrapper again in a synchronous fashion, which causes the wrapper, the original function, and the data retrieving function to be called a second time; when the data retrieving function is called the second time, retrieving the data that was previously saved by the direct callback function; and when control returns to the direct callback function, returning the data retrieved by the data retrieving function to the calling function by calling a consumer callback function identified for the calling function.