R
rawCoder
Hi all,
How Can You Raise Events Asynchronously ?
Now for the details ...
I want to do inter modular communication using events in such a way that the
contributing modules need not maintain the reference to any module.
For e.g. There is one EventManager class that has event declaration and
public functions that raise events. So any other class that needs to publish
data to interested classes, can call the event raiser method of the
EventManager class. The interested classes would already by handling the
event and will get the notification/data.
Public Class EventManager
Public Shared Event m_Notification()
Public Shared Sub NotificationRaiser()
RaiseEvent m_Notification()
End Sub
End Class
Thats fine and working. Now the problem is that the Event raising mechanism
in .NET is synchronous so in above example the control wont leave the
NotificationRaiser until all classes that handle the notification have done
their task. I would like this to be on separate thread (as much
automatically as possible - dont wanna do the plumbing myself).
So is there any way to raise some event asynchronously (like on some other
thread) without the reference of the class that is handling the event.
I hope I made myself clear, if there are still any queries .. then plz lemme
know.
Any suggestion or reference is welcome.
Thanx
rawCoder
How Can You Raise Events Asynchronously ?
Now for the details ...
I want to do inter modular communication using events in such a way that the
contributing modules need not maintain the reference to any module.
For e.g. There is one EventManager class that has event declaration and
public functions that raise events. So any other class that needs to publish
data to interested classes, can call the event raiser method of the
EventManager class. The interested classes would already by handling the
event and will get the notification/data.
Public Class EventManager
Public Shared Event m_Notification()
Public Shared Sub NotificationRaiser()
RaiseEvent m_Notification()
End Sub
End Class
Thats fine and working. Now the problem is that the Event raising mechanism
in .NET is synchronous so in above example the control wont leave the
NotificationRaiser until all classes that handle the notification have done
their task. I would like this to be on separate thread (as much
automatically as possible - dont wanna do the plumbing myself).
So is there any way to raise some event asynchronously (like on some other
thread) without the reference of the class that is handling the event.
I hope I made myself clear, if there are still any queries .. then plz lemme
know.
Any suggestion or reference is welcome.
Thanx
rawCoder