473,326 Members | 2,136 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,326 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 9819
"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; }
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.