Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
So far, the weather application that you created is sending as many requests for weather data as the user types in city names. However, the order in which the data comes back from the weather web service is not guaranteed. For example, if the user first types in New York and then types in Boston, the weather results for New York City may come in behind Boston, yet the user would not realize that they're seeing New York's weather when the search term Boston remains on the screen. It would be great if a solution gave the application the power to cancel out all weather requests that occurred prior to the latest one. In this case, for example, a request for New York weather would be canceled as soon as the request for Boston weather was made.