I want to be able to cancel reading from a database or http request instantly when our app is reading some data from either and the user hits the cancel button. Neither call is immediately cancellable, even for the async versions of the calls.
What if I set the code to end the task as soon as the next database/http call completes? And then forget about that task and continue on in my app? The one downside I can see is if the task does not complete before the user exists the app.
Update: JPVenson provided a great solution for doing this right for http and ADO.NET. However, we also at times do this making calles to the Salesforce API which as best as I can figure out, has no cancel mechanism. So the problem remains for that case.
On a cancel I don't need what is being returned so from my apps point of view, I'm fine forgetting about the task. Is there any down side to doing this?