There is code in my ASP.Net 4 web application that starts the process for a long script. The standard output is read, and the return value is updated in the database. I would like to “run and forget” this bit of code so that my user interface remains responsive and the user does not need to wait for these two operations to complete. The end result of these two operations is not needed by the calling code, so I don’t think I need to “wait” and I don’t need any signs of success or failure.
All the available options scare me. What is the best way to encode this so that these two operations are just sent to their fun path and do their work on their own?
Well, the “best way” can be controversial, but I would continue using with TPLsomething like the following:
TPL
Task parentTask = Task.Factory.StartNew(() => SomeMethod(someParameter));
Note. If the "long running script" calls the WCF service, the following article on WCF asynchronous programming may be helpful. http://blogs.msdn.com/b/wenlong/archive/2009/02/09/scale-wcf-application-better-with-asynchronous-programming.aspx
I think you have mixed terms.
WCF - - , .
, , , , .
- ASP.NET, , TPL, Tasks. async await #, .
Tasks
async
await
TPL , , , .NET.
, , .
" "
" " - ASP.NET.
. (HttpClient .NET UI; AJAX HTML-).
HttpClient
- .
-? , " " , . " " , , , .
, "" . , :
HostingEnvironment.QueueBackgroundWorkItem
Source: https://habr.com/ru/post/1542514/More articles:How to call GSAP function when turning on a slide using Reveal.js? - javascriptAngular ng-if directive does not evaluate conditional expression - javascriptWhat conditions can prevent layoutSubviews from being called after setNeedsLayout? - iosMake bounce animation - androidFlask-Restful interrupt method ignores CORS variants - pythonThe loop repeats only once with `ssh` in the body - bashHow to enable Paredit in Light Table? - keyboard-shortcutshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1542517/how-to-bind-data-from-mutiple-tables-to-datagridview-using-entity-framework-and-use-crud-operations&usg=ALkJrhg7FYsD1D7y6nsf4g5LGzKTybYLjQChange R C ++ C / C ++ Compiler on Kubuntu Linux - gccLaravel max Validator not working - phpAll Articles