473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to not block on long requests?

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

Nov 5 '06 #1
1 1053
Hi Jeff,

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

Fred

Jeff wrote:
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
Nov 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andy Leszczynski | last post by:
I need a HTTP server handling long lasting requests e.g. 10-30 seconds. Below is a pice of the code. In order to make the server reponsive while handling othere requests I use...
31
by: Jamie Burns | last post by:
Hello, I am writing a client / server application. There is 1 server, and many clients. The server processes requests from each client, and typically creates and manipulates C++ objects on their...
4
by: Wow | last post by:
It is so easy to change user-agent string, so don't even bother. I don't know how yahoo blocks all. Here is what they did it Please try to user Perl's useragent even changed the useragent to...
2
by: Seth | last post by:
Ok, here is my setup. I have a fully functioning HTTP Handler implemented. The handler is supposed to handle every single request that comes in to a particular virtual directory. Thus, in IIS, I...
0
by: Jm | last post by:
Hi All I recently got some help with code conversion that i used in vb6 to block a specific tcp port. The code runs under a timer and is run on a very low tick count (Meaning it happens...
1
by: peterlan | last post by:
Hello, I have an issue with a long-running import process in our asp.net app (1.1). After the user initiates an import, we're trying to make periodic xmlhttp requests to update a progress bar. In...
2
by: Julio C. Hernandez Castro | last post by:
Dear all, We have just developped a new block cipher called Raiden, following a Feistel Network structure by means of genetic programming. Our intention now consists on getting as much feedback...
2
by: =?Utf-8?B?SUthdHphdg==?= | last post by:
Hello All I have a web application Asp.Net 2.0 with Oracle DB. I have one event that takes 1-5 miuntes, when the event is short it suceeded but where a lot of action are required and the event...
1
by: Christoph Boget | last post by:
I'm experiencing a very odd problem and it's happening only in IE6. IE7, Safari, Opera and Firefox are all working properly. What's happening is that I'm using XHR request responses to update the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.