Patent ID: 8572585

Claim:
At a computer system including one or more processors and system memory, the computer system also including an accessor module, a recognizer module, an identifier module, and a rewriter module for converting source code into executable code, a method for representing an asynchronous method call, the method comprising: an act of accessing a portion of source code; an act of recognizing an asynchronous method within the portion of source code; an act of identifying a builder object corresponding to the asynchronous method based on one or more of the return type of the asynchronous method and other contextual information of the asynchronous method call, the builder object including instructions to expose one or more future states of the asynchronous method through a handle; an act of identifying a producer method configured to instantiate an instance of the builder object; and an act of receiving the identity of the asynchronous method, the builder object, and the producer method from the identifier module and rewriting the asynchronous method to: use the producer method to instantiate an instance of the builder object, generate a handle from the builder object to represent one or more future states of the asynchronous method, return the handle, and pass information about operation of the asynchronous method through the handle such that the state of the asynchronous method is trackable prior to and after completing.