Questions tagged as 'async'

2
answers

Using async="" will result in a synchronous or asynchronous load?

I'm using this function to load my scripts into a single line: function loadJS () { for (var i = 1, max = arguments.length; i < max; i++) { var file = document.createElement("script"); file.async = arguments[0];...
asked by 24.08.2017 / 20:07
1
answer

What are the pros and cons of the TaskListObject implementation on ListObject

What are the advantages between the two implementations below. Both return a list with several products (more than 1k): public Task<List<Product>> GetAllProductsAsync() { var query = Products.ToList(); return Task.FromResu...
asked by 01.08.2015 / 16:26
3
answers

ASP.NET MVC5 - Asynchronous Methods on the Controller

I'm developing an MVC layer for an ASP.NET system written initially in WebForms. It does not use EntityFramework, so a good part of the system I had to work out a homemade solution. In order to use Ajax's asynchronous methods with the MVC5 Co...
asked by 26.02.2014 / 20:14
2
answers

await Task.WhenAll how to run multiple processes?

I am trying to create several task (async) they will execute the following logic: Parse an Html based on a url received with the HtmlAgilityPack Return a product model after parse Insert the Product into the database Download product i...
asked by 11.10.2016 / 20:36
1
answer

Report progress for interface of an asynchronous method in C #

I have a Windows Forms application. This application will run some processes that take a while to run, so I would like to run them in parallel. Here's a little of what I'm trying to implement. In the form constructor, I create a generi...
asked by 09.09.2014 / 19:53
1
answer

Using synchronous methods along with asynchronous

For development reasons, I had to create a call to an asynchronous method in a synchronous method, but when I publish my project to the server, it is for an indefinite time running. Asynchronous method public static async Task<IEnumerabl...
asked by 26.01.2017 / 15:07
1
answer

Async Methods - return string from UDP

I'm developing a code whose purpose is to send a packet with a broadcast string and then read the response (if any), however I want to create a method that just returns the response string. I have the following, based on the example provided by...
asked by 17.10.2017 / 17:05
2
answers

C # Difference between BeginAccept and AcceptAsync

What is the difference between the two asynchronous forms? Which has better performance by handling sockets and handling thousands of connections simultaneously? Example for BeginXXX: link Example for XXXAsync: link     
asked by 12.06.2014 / 00:59
1
answer

Task.Run always starts a new Thread?

When executing a list of tasks started through Task.Run, is it guaranteed that each one is executed on a different Thread? When reading the documentation, it seems to me that this is the default behavior, while doing the tests I was validatin...
asked by 10.08.2016 / 21:43
2
answers

What is the difference between async Task and void?

I use async Task with await when I need my code to wait for this task to complete until I run another process. In the case of void methods, without async-await , does my code also not "wait" to execute another proce...
asked by 27.07.2017 / 18:30