Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asynch Operation

Status
Not open for further replies.

jmarler

Programmer
Jan 29, 2001
679
US
Does anyone here know of a good way to fire off an Asyncronous method call in Visual Basic (preferably without using a timer). Any info would be greatly appreciated. - Jeff Marler
(please note, that the page is under construction)
 
Aside from my atrocious misspelling (Asyncronous = Asynchronous :)I ), Asynchronous is the ability to call a method and then go onto the next line of code without having to wait for the method call to finish. Ideally, in a single process, this would require firing off another thread (something VB.net allows, but not VB6).
The best way I can think of in VB6 to do this is to use MSMQ (which is finally what I ended up doing), but I was wondering if anyone knew of a different/quicker/better solution.

- Jeff Marler
(please note, that the page is under construction)
 
Thanks for the help Eric! Unfortunately, MS KB does not have any articles for what I want to do other than to suggest raising events for asynchronous callbacks (which for this application architecture - ASP/MTS - is not possible). I think that I am going to stick to the MSMQ option since I am almost finished with the required code. But I did want to thank you for your input! - Jeff Marler
(please note, that the page is under construction)
 
tedsmith,
just read your profile . . . you started on 6800 processors? I started by learning assembly on the 6809. OK . . . off the topic I know, but I thought I'd throw it in. :)
- Jeff Marler
(please note, that the page is under construction)
 
and the advantage/disadvantage of using Asynch?
Anybody know?
 
oneshadow,
The advantage of Asych function calls is background processing. The disadvantage is that the code will not wait or receive a response. So any code following the Asych call should not rely on the results of the Asych method call.
For example . . . I am reworking a web app for someone right now. All of the code right now is in ASP script and when customers place large orders the required processing can take more then 10 minutes which currently will lock up the web servr and cause the users session to time out (processing is done on the submint). Since the user in this case does not need an immediate response (remember that code following the Asynch call can not rely on data produced from the Asynch call), I have redone the system so the the submit process simply dumps all of the required data into a message within MSMQ and then immediately returns a verification page to the user letting them know that an email will be sent with more info. In the meantime, a VB app (running as an NT service) sees the message in MSMQ and begins the required processing. When that processing has completed, the service sends an email to the user with all of the required information regarding their order.
That is how to use an asych method call. Hope that explained it a bit for you! :)
- Jeff Marler
(please note, that the page is under construction)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top