"Fire and forget" asynchronous methods

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I want a class to fire a method in another class, and once it fires
it, to not care about what happens (i.e., if there are errors, return
values, etc). I want this to happen asynchronously.

I read this post:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=812beb6be4fd2339&rnum=2

And the MS guy says that calling EndInvoke does more than simply wait
for the end of the call. Well, what *does* it do? Must I really call
it, or can I forget about it. My main concern is that the thread
won't terminate, that it will somehow stay open. Will this happen?

The basic idea I am implementing is a message dispatcher using
asynchronous communication to other classes. It simply routes
messages between objects and should never care about success, failure,
or error (these are handles by the final receiver of the message).

Thoughts?
 
Hey Mike,

I don't know if I would define EndInvoke as waiting for the end of the call.
I've only called EndInvoke within my callback, in which case it returns an
emitted value based off the method...

I don't think this is the answer you want. Personally, I would look into a
threadpool and QueueUserWorkItem... that sounds more like what you want.

-CJ
 
Back
Top