473,386 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

"Fire and forget" asynchronous methods

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=e...4fd2339&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?

--
Mike
Nov 20 '05 #1
1 1533
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
"Mike" <mi*********@hotmail.com> wrote in message
news:cb**************************@posting.google.c om...
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=e...4fd2339&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?

--
Mike

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Fred | last post by:
There is a setting in INIT.ORA that has the unintended side-effect of making sure the ALTER SYSTEM KILL SESSION command has immediate affect. Without this setting, I've seen some instances where...
5
by: Kai Grossjohann | last post by:
On unload of a page, I store the current scrollbar position (ie, window.pageXOffset and window.pageYOffset) into a cookie. On load of that same page, I fetch the information from that cookie and...
2
by: pgsql | last post by:
I am doing asynchronous sql calls using the postgres C library. After doing two PQsendQuery() calls, I get the "another command is already in progress" error. The two calls I am doing are an...
0
by: frenzy | last post by:
I am doing asynchronous sql calls using the postgres C library. After doing two PQsendQuery() calls, I get the "another command is already in progress" error. The two calls I am doing are an...
4
by: Keith Chadwick | last post by:
I am having some trouble referencing an Application("myVar") variable from within a module.vb file on my ASP.NET site. According to the documentation I should be able to reference...
9
by: rsine | last post by:
I have developed a program that sends a command through the serial port to our business system and then reads from the buffer looking for a number. Everything worked great on my WinXP system, but...
2
by: JohnQ | last post by:
Yeah, I'm a lil burnt out and need to go elsewhere. I'll go do that. I know how bad it gets when I mix livelihood.. no, I didn't mean that! I was harkening back to when I worked as a wage slave and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.