call async method without await #2
I have an async method:
I have an async method:
So, I have this Web API action, that executes an asynchronous function. public void Post([FromBody]InsertRequest request) { InsertPostCommand.Execute(request); DoAsync(); } private async void DoAsync() { await Task.Run(() => { //do async stuff here }); } I actually want the controller action to return to the client whilst the async operation executes. I did this and … Read more
I am building a set of ASP.Net hosted WebAPI services that must use an old library which depends heavily on HttpContext.Current. I am having trouble ensuring that context is preserved in all the methods that participate in an async call. I have tried several variations with await/Task.Wait and TaskScheduler.FromCurrentSynchronizationContext() on the below code.
When a new async thread has been spawned using this signature, will the ASP.NET session object be available to the this new thread?
What is the benefit of using async with the ASP.NET QueueBackgroundWorkItem method?
I have a method in ASP.NET application, that consumes quite a lot of time to complete. A call to this method might occur up to 3 times during one user request, depending on the cache state and parameters that user provides. Each call takes about 1-2 seconds to complete. The method itself is synchronous call to the service and there is no possibility to override the implementation.
So the synchronous call to the service looks something like the following:
I’m looking for the proper way to handle multiple database calls that would likely benefit from running simultaneously. The queries are just to stored procedures that are either doing inserts or merges using data that is programmatically assembled into DataTables in my ASP.NET MVC app.
Can someone provide me with a simple example of Asynchronous page processing in ASP.NET Webforms 2.0 (I’m using VS 2010, so new syntax like lambdas are ok)?
An ASP.NET 3.5 webapp has to start several tasks that takes hours to complete. For obvious reasons the pages which starts these tasks cannot wait for them to finish nor will anyone want to wait that long to get a response, so the tasks must be asynchronous.
My problem is very similar to this question here. I have an AuthenticationService class that makes an HttpClient PostAsync() and never returns the result when I am running it from the ASP project, but when I implement it in a Console app it works just fine.