asp.net - Concurrent page processing/serving -
i've created web application has sub builds contacts list. sub fetches phone numbers , email address contacts db based on ids provided user. @ it's fastest, application process 4 ids per second. 200-300 ids @ given time, completion time long.
time not problem, it's end user status updates. i've created crude web service reads "currentrecordnumber" stored in session variable app loops through ids. intend use javascript call webmethod app periodically update status.
my problem when debugging, webmethod call complete successfully, not until app finished processing.
this seems simple problem. must not using right terms because results seem overly complicated.
i'm new asynchronous features of asp.net please forgive. have, however, written winforms incorporate multiple threads have basic understanding of threading.
this due way asp.net treats session. haven't said whether using webforms or mvc, mvc has quick workaround this.
first, problem: sessionstate designed accessed 1 request @ time, in order received server. think of queue @ bank 1 bank teller available. first person in line first helped (though on per-session basis, not per-user).
asp.net locks other requests require sessionstate executing until previous 1 done.
i haven't tried correct problem in web forms, easiest way know of not require sessionstate on progress check.
in mvc, there's sessionstate attribute can applied controller or method, indicating there's no chance of call method overwriting sessionstate. long call read-only, can make controller code use attribute allow multiple async requests simultaneously:
<sessionstate(sessionstatebehavior.readonly)> public class mycontroller
Comments
Post a Comment