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

Discussion in 'ASP .Net' started by Jeremy S., Aug 21, 2009.

  1. Jeremy S.

    Jeremy S. Guest

    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.
    Jeremy S., Aug 21, 2009
    #1
    1. Advertising

  2. On Fri, 21 Aug 2009 11:34:56 -0700, "Jeremy S." <> wrote:

    >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.
    Registered User, Aug 22, 2009
    #2
    1. Advertising

  3. Jeremy S.

    Jeremy S. Guest

    <snip>

    >> 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.



    Ah - I never would have thought of that. Thanks for the idea.
    Jeremy S., Aug 22, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simple Simon

    Server-Side Asynchronous Web Method help

    Simple Simon, Aug 13, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    625
    Simple Simon
    Aug 13, 2003
  2. Morgan Cheng
    Replies:
    0
    Views:
    363
    Morgan Cheng
    Aug 6, 2007
  3. Navin Mishra

    Newbie:Questions about server side asynchronous web methods

    Navin Mishra, Jul 13, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    110
    Navin Mishra
    Jul 13, 2005
  4. Peter Yao
    Replies:
    0
    Views:
    129
    Peter Yao
    Jun 25, 2007
  5. Replies:
    0
    Views:
    327
Loading...

Share This Page