I’m developing a module that has to handle many events coming from an external system.
I’ve to use a third party class providing an event (OnNewMessage) passing some parameters as input and two as output, each event require a bunch of time in order to be processed. I’d like to serve these events in a parallel way, in order to avoid blocking the caller and to process multiple request in parallel.
Here an example of my code:
void Init()
{
provider.OnNewMessage += new OnMessageEventHandler(processEvent);
}
void processEvent(string xml, int …, out string resultXML, out string description)
{
...
}
Which is the best approach to do this in C# 3.5?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…