Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

drawback of asynchronous communication  RSS feed

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When user click on any link, he/she has the flexibility to click on other links also even if the first request is not being responded (because it's an asynchronous communication) for example in Gmail. So, what happens it, all requests are mess up and end up with nothing or inappropriate result....

What's your opinion??


[ July 11, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
People quickly learn not to do that.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
People quickly learn not to do that.


But then why Gmail and AJAX are so famous???

:roll:
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rathi ji:

But then why Gmail and AJAX are so famous???


Non-sequitor. Your facts are uncoordinated.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:


Non-sequitor. Your facts are uncoordinated.


Actually, I concluded form your post, 'developers quickly learn not to use that'

So, I again made my point, 'why they are famous'.

 
Scott Selikoff
author
Bartender
Posts: 4081
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is one of the many reasons the back button does not work on a lot of transaction-based websites. If you hit the back button you get an expired page error.
 
Steve McClintic
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are they famous? Hype, marketing, catchy name. You can write code to prevent duplicate requests. This thread should probably be moved to a different forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Steve McClintic:
This thread should probably be moved to a different forum.


Why? I think it's fine here seeing as we don't have a general "web tech" forum.

My original point is that it's the nature of the browsers and the technology that supports them that randomly clicking here and there isn't likely to yield pleasing results. People quickly learn not to do that (same way that people quickly learn the value of pot-holders) and those that insist on practicing that behavior shouldn't be surprised when things boof up.

Thre are things we can do as web devos (such as detecting and preventing multiple submissions and the like), but if users want to hit themselves in the middle of their foreheads with ball peen hammers, there's only so much we can do for them.
[ July 12, 2006: Message edited by: Bear Bibeault ]
 
Steve McClintic
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Randomly clicking here and there was a testcase that one of my application owners used to do during a user acceptance test. If the app (web or not) couldn't "gracefully" handle anything, then she'd log it as a defect and fund my group to fix it.

I'm still new here and assumed that this all would be moved to that Ajax-related forum.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't move it there because the question isn't Ajax-related. You can multi-click on any web page with more than one link, and I've even done it on this forum. It's just a general question about web design or something -- actually I'm not sure what the category is at all.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is called you have to build smart requests, dumb requests will have problems!

You need to look into building a queue and knowing what came first, the chicken or the egg. If you code your client correctly you will know the answer.

Eric
 
abhijit Ohal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i worked on Ajax in one of my module.
Reason why it is famous .
eg. we have big form lets say customer details forms.
if he choose country populate it's cities. it will get back server again for cities then unnecessary server trip . also the detailed filled by him may get lossed. this can be achieved by asynchronus request by AJAX which will never messed up with other requests.
also avoid page refreshed.& fast response. proper developement of AJAX never have any problem.
Actually it is not the techology. we are using it from long time .but due impressive use of AJAX in google map, gmail,rediffmail get it's name.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a little web server and kept seeing exceptions that I didn't expect. It took me a while to figure out somebody hit a link for a page and then hit another link or a navigation button before I sent the response. When I got around to sending the response, the browser was no longer interested and my server got a connection terminated by peer or some such error. I reproduced it for testing by banging very fast on the refresh button.

So one side effect of the user switching context while an async process is running is that the process runs to completion and then fails. If they do this enough they can eat up a lot of server resources. And they're probably hitting refresh or another link because the server is already stressed and slower than usual and they're getting impatient and making things worse. Ouch.

I don't work on the front end logic on my work application much, but async has some pitfalls there, too. Some of the async server calls are done in a frame on behalf of a child window, and the child window can change before the response gets back. Generally the outer frame tries to do a callback on a child that no longer exists and it's a fairly graceful error. But there are a few places where we have to be very careful to keep the responses in sync with the requests.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometime overnight the phrase "asynchronous client" finally fell in place in my brain. In several prior projects I faced situations where async replies might come back out of sequence or long after the user has gone on to other things. To solve this kind of problem it is common in messaging systems for the send to generate a unique correlation id and the request to embed the same id.

In Java I made Command pattern objects to hold the code that should run when the response comes back and put them in a map keyed by correlation id. When a response comes in, get the id, get the Command and execute it. I don't know if you can do such a thing in JavaScript but the correlation id idea might help even if you can't.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!