When you fire an ajax call, what we typically do in the browser side code is have a "xmlhttp" variable and check for status changes until the response is loaded, which means the client side maintains some sort of connections/thread to the server and the server responds via that connection back to the client. The only difference I see is that the page is not refreshed and that brings me to the very basic question, is ajax really asynchronous?
Compared to JMS where the request is sent and there is absolutely no connection between the Client and Server and the response is sent via different thread initiated by the server. Isn't JMS really asynchronous. I'm confused. Can someone please clarify.
AJAX is said to be asynchronous in the sense that waiting for requests does not block the page's user interface. In other words: when you send a whatsapp message and you actively wait for the reply, then you are doing a synchronous request: no matter if your wife is asking you for going to bed. You won't go to bed until you get the reply. But if you send the message and you still want to do other things like going to bed with your wife, then you'll do an async request: you will read the message when the phone rings (an AJAX onload event).
The UI thread of a web page would be your wife.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With