Server-side Asynchronous Calls in Web App - Of what Value?

  • Thread starter Thread starter Jeremy S.
  • Start date Start date
J

Jeremy S.

I understand asynchronous calls in a Web app that are initiated from the
browser via AJAX (whatever implementation may be in use). In these scenarios
we are updating the rendered page (DOM).

But what about async calls initated in server-side logic. I'm wondering if
there is any use for server-side asynchronous calls. While code-behind logic
*can* spawn a background thread and execute some call on that thread, the
page will proceed to render to the browser possibly/likely before the async
call returns. So, is there any way to get the async call to participate in
the page lifecycle? If not, then is there any reasonable use for such
server-side async calls? Or are such server-side calls mostly good for
activities that do not need to interact with the Page that gets rendered
(e.g., write some log file entry on the background thread and let the page
render while that operation is taking place)?

Just looking for some thoughtful discussion... not trying to solve a
particular problem here.
 
I understand asynchronous calls in a Web app that are initiated from the
browser via AJAX (whatever implementation may be in use). In these scenarios
we are updating the rendered page (DOM).

But what about async calls initated in server-side logic. I'm wondering if
there is any use for server-side asynchronous calls. While code-behind logic
*can* spawn a background thread and execute some call on that thread, the
page will proceed to render to the browser possibly/likely before the async
call returns. So, is there any way to get the async call to participate in
the page lifecycle? If not, then is there any reasonable use for such
server-side async calls? Or are such server-side calls mostly good for
activities that do not need to interact with the Page that gets rendered
(e.g., write some log file entry on the background thread and let the page
render while that operation is taking place)?

Just looking for some thoughtful discussion... not trying to solve a
particular problem here.
Async server-side calls can be extremely useful in certain situations.
A number of years ago I did an eCommerce project (auto parts) using
Webhub and Delphi. The item information came from a central catalog
while the pricing was store-specific. Pricing requests and orders were
sent to a tier which bridged the Internet and a private network.

In theory all the stores were to be visible to the middle tier all the
time. The reality was not that all the stores were visible to the
middle tier all the time (dodgy connectivity etc.). The tier's request
would time-out in 30 seconds if the store failed to answer. The
response time to the web app's request could be anywhere from near
immediate to 30 seconds.

When an async pricing request was made the client received an
intermediate page indicating a request was in progress. That page
would reload every X seconds to check the async result. Once the async
result was received the client would be served the requested page.

Although it sounds like a kludge, it served its purpose. Instead of
having to wait and wonder what was happening, the user received
continuous feedback that the request was in progress.

That is my experience with server-side async calls.

regards
A.G.
 
Back
Top