Im is developing a module that should handle a lot of events coming from an external system. Ive used a third-party class that provides an event (OnNewMessage) that passes some parameters as input and two as output, each event takes a lot of time to process. The identifier must execute these events in parallel in order to avoid blocking the caller and process several requests in parallel.
Here is an example of my code:
void Init()
{
provider.OnNewMessage += new OnMessageEventHandler(processEvent);
}
void processEvent(string xml, int …, out string resultXML, out string description)
{
...
}
What is the best approach for this in C # 3.5?
thanks
source
share