I've been asked to use an API that makes http calls to a server behind the scenes.
Unfortunately, all the calls are synchronous. I'd like to wrap the classes in this API so that I can make async calls, with the ability to cancel calls.
It would be a licensing violation to publish a WCF service that exposes this API.
¿Existe un patrón para hacer esto?
preguntado el 08 de noviembre de 11 a las 16:11
You can always fire off a new Task that runs in a new thread with
Task.Factory.StartNew. If you need the competition notification on a non threadpool thread, I recommend using a
SynchronizationContext to schedule it to a different thread.