Hello,
I'm currently designing an assembly that will be used by third parties. One of the classes has a long process of TCP connections and it informs about its process using events. For example
''# Do stuff that takes some time
RaiseEvent CompletedFirstPartEvent()
''# Do stuff that takes some time
RaiseEvent CompletedSecondPartEvent()
''# Do stuff that takes some time
RaiseEvent CompletedSecondPartEvent()
What I've seen if that if the handler of one of those events takes too long (or even worse, it blocks) I can have timeouts and it's hard for the developer to see that one class is not working fine because his handler is taking too long.
I was going to fire the events in a new Thread to avoid this issue but this looks strange to me because I've never seen something like that, what I've seen until now is the developer spawning a new Thread if his handler was going to be timeconsuming. So the question is:
What would you do? Create a new thread or force the user to create his own thread? (Or is -there a better approach that I don't know?)
Thanks in advance.