How to not block on long requests?

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

I have a worker thread that calls into a 3rd-party application that can
take a long time to respond to API calls. How can I make sure that my
worker thread promptly responds to stop requests from my main UI
thread? Should my worker thread spawn yet another thread for calls into
the 3rd-party app so that it can continue to monitor stop requests?
That sounds overly complicated to me. Are there any patterns you can
suggest?

Thanks,
Jeff
 
Hi Jeff,

Look at the System.ComponentModel.BackgroundWorker class. It should
respond your needs.

Fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top