472,374 Members | 1,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Synchronous vs. Asynchronous

I have two different scenarios:

1. I have an application that calls a web service and passes an
object. Web Service takes that object and does some stuff with it, which
could take some time. It seems to me that in this case it would be
appropriate to use asynchronous web service. Am I correct?

2. I also have another application that calls a different web
service. In this scenario the calling application may call this web service
many times in a row and I don't want to wait while it processes the data
from the previous call. On important thing is that I must get the return
value for each of those calls. Would it be appropriate to use asynchronous
web service in this case? If not, what would be a good way for me to solve
the potential bottle neck?

Thanks,

Alex.
Nov 21 '05 #1
1 9752
"Alexander Kaplunov" <ak*******@nvidia.com> wrote in message news:Op*************@TK2MSFTNGP15.phx.gbl...
1. I have an application that calls a web service and passes an
object. Web Service takes that object and does some stuff with it, which
could take some time. It seems to me that in this case it would be
appropriate to use asynchronous web service. Am I correct?
That's correct. Often, invoking a web service call has some latency associated
with it, so a better question is when is it justifiable to make a synchronous (blocking)
call to a web service? [One-way messages, batch processing systems with absolutely
nothing else to do, dedicated thread devoted to one or multiple sequential calls, and
troubleshooting a client when you want to disentangle the complications of asynchrony
from the problem under investigation.]

I fully agree that if the web service is a long-running remote process, it is best called
in an asynchronous manner. Additionally, if the client is interactive and needs to have
a responsive user interface, the web service should be called asynchronously.
2. I also have another application that calls a different web
service. In this scenario the calling application may call this web service
many times in a row and I don't want to wait while it processes the data
from the previous call. On important thing is that I must get the return
value for each of those calls. Would it be appropriate to use asynchronous
web service in this case?
You can (should) make all of the web service calls asynchronously. However,
your design has to contend with the possibility that the web services may return
in a different order than you had called them.
If not, what would be a good way for me to solve the potential bottle neck?


Another option you haven't mentioned, is to dispatch several one-way web
service calls (with some token ID that identifies their "batch number") and
then fire off a web service call that retrieves all of that data (by it's "batch
number.") Not that I wouldn't make that ultimate call asynchronously, too,
but this approach may help you handle the data management aspects by
receiving the result set from one call instead of many calls coming back in
an unpredictable order.
Derek Harmon
Nov 21 '05 #2

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

Similar topics

1
by: Noel | last post by:
Hi, I am a tad confused about if there are any benefits from using asynchronous vs synchronous network communication. As my example, I have been writing a dns lookup stack with a network...
1
by: Chris | last post by:
Hi. I have a ibrary I'm trying to use via javascript within IE. This library uses an asynchronous model where I call into a function and pass it a callback function as one of its arguments. My...
15
by: Javier Estrada | last post by:
Can someone explaing the difference between these exception models regarding the structured exception handling? The documentation is not clear. Some code would actually help. Thx
3
by: Pro1712 | last post by:
Hi, this may be a stupid question: How can I can call the DoWork-function of a BackgroundWorker synchronous? Or in other words: How can I extend the BackgroundWorker class with a function...
4
by: Ryan Liu | last post by:
TcpClient has a method called GetworkStream GetStream(); So in other words, there is only one stream associate with it for input and output, right? So while it is receiving, it can not send, and...
2
by: Gary Wessle | last post by:
Hi what is the difference between synchronous vs. asynchronous messages an object sends to another. google was not much of a friend and wikipedia did not come to the rescue. thanks
5
by: HugeBob | last post by:
Hi All, I've got a question about Asynchronous vs Synchronous mode with the XMLHttpRequest object. What are the ramifications of using one mode vs the other? If the script uses Asynchronous...
0
ammoos
by: ammoos | last post by:
hi friends pls help me.. i got an assignment which i feel very difficult to me.. i dont have more knowledge about multi-threading in .net... the assignment details is below.... pls help me... i...
4
by: kp7796 | last post by:
What is synchronous function? What is asynchronous function? Unsigned char a=0; Void function (void ){ Unsigned char Flag; Flag=0 If (a==1){ Flag=1; }
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.