473,799 Members | 2,868 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"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 1559
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 QueueUserWorkIt em... that sounds more like what you want.

-CJ
"Mike" <mi*********@ho tmail.com> wrote in message
news:cb******** *************** ***@posting.goo gle.com...
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
9785
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 the session reports as being KILLED in V$SESSION but is not physically removed until the instance is bounced. Does anyone remember this value offhand?
5
1849
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 scroll the window accordingly. I used the name "remember_scrolling" for the function doing the store, and "recall_scrolling" for the function doing the fetch. (There is also a function which deletes the cookie. It is named "forget_scrolling".)
2
8820
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 update, and then an insert, in that order. I am doing this for speed, since my program can't afford to wait for the answer from the first to complete before making the request for the second. For some reason this method has started giving the...
0
460
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 update, and then an insert, in that order. I am doing this for speed, since my program can't afford to wait for the answer from the first to complete before making the request for the second. For some reason this method has started giving the...
4
1665
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 System.Web.HttpApplication but it does not seem to like that one bit. I also have a MSXML2.DOMDocument30 defined as a public object within the vb module which is loaded during the application start up with a bunch of XML. What is weird is that the data contained...
9
7136
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 when I tried the program on the Win98 system it will be running on, I get the following error: Cast from string "2076719" to type 'Long' is not valid I am not sure why I only get this error on the Win98 system or how to go about correcting...
2
1269
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 fell in love. It was good love then. Well and now too. But, I was not free. I was taking "the giant leap of faith". I think the love would have been good. I'm not going to characterize a past love (read, a real woman, geeks (!), not a...
0
9550
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.