I have a question about event handling with C#. I listen to events a class A throws. Now when the event ist thrown a method is executed that does something. This method sometimes has to wait for respones from datasources or similar.
I think event handling is synchronous so one after another event will be processed. Is it possible to makes this asynchronous? I mean that when the method is executed but has to wait for the response of the datasource another event can be processed?
Thanks in advance
Sebastian
I assume that you can spawn the code that needs to wait in a new thread. This would cause the event handler to not block the thread on which the events are being raised, so that it can invoke the next event handler in line.
(C# 3.5 sample)