multithreading - BackgroundWorker thread in ASP.NET -


is possible use backgroundworker thread in asp.net 2.0 following scenario, user @ browser's end not have wait long time?

scenario

  1. the browser requests page, sendemails.aspx
  2. sendemails.aspx page creates backgroundworker thread, , supplies thread enough context create , send emails.
  3. the browser receives response composeandsendemails.aspx, saying emails being sent.
  4. meanwhile, background thread engaged in process of creating , sending emails take considerable time complete.

my main concern keeping backgroundworker thread running, trying send, 50 emails while asp.net workerprocess threadpool thread long gone.

if don't want use ajax libraries, or e-mail processing long , timeout standard ajax request, can use asynchronouspostback method "old hack" in .net 1.1 days.

essentially have submit button begin e-mail processing in asynchronous state, while user taken intermediate page. benefit can have intermediate page refresh as needed, without worrying hitting standard timeouts.

when background process complete, put little "done" flag in database/application variable/whatever. when intermediate page refresh of itself, detects flag , automatically redirects user "done" page.

again, ajax makes of moot, if reason have intensive or timely process has done on web, solution work you. found nice tutorial on here , there plenty more out there.

i had use process when working on "web check-in" type application interfacing third party application , import api hideously slow.

edit: gah! curse guzlar , god-like typing abilities 8^d.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -