"Fire and forget" asynchronous methods

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?
 
C

CJ Taylor

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top