473,381 Members | 1,463 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,381 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 9823
"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; }
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.