Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is the modified answer:</p> <p>you don't want to block the caller , and you also want the caller to wait for the output. Then I think what you need is a web service. You define a web service for the task. And the caller call the web service to get the result. Web services support parallel processing.</p> <p>I suggest you to use <a href="http://msdn.microsoft.com/en-us/library/ms731082.aspx" rel="nofollow">WCF</a>. WCF has a request/reply message pattern, where one endpoint requests data from a second endpoint. The second endpoint replies. WCF is such a big topic and I am sorry that I can't dive into the detail here. But you could easily start with <a href="http://channel9.msdn.com/shows/Endpoint/Endpoint-Screencasts-Creating-Your-First-WCF-Service/" rel="nofollow">this video</a>. And here are <a href="http://msdn.microsoft.com/en-us/netframework/dd939784" rel="nofollow">more videos</a> for you.</p> <p>==================== below is the old answer ===================</p> <p>You could start a new thread for each event:</p> <pre><code>void processEvent(string xml, int …, out string resultXML, out string description) { new Thread(Handler).Start(xml); } void Handler(object xml) { //do the actual work here } </code></pre> <p>Each caller request will get responded by a thread immediately, so the caller will not be blocked. And each thread will quit automatically after finishing processing the request, so there will not be too many threads in your system. </p> <p>This is just a simple solution. You might want to consider thread pooling in order to improve performance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload