iasyncenumerable Questions

3

Solved

I want to ask if there is a plan or exists a method to aggregate the return(s) of an IAsyncEnumerable? So given the below method why is there no terse way to aggregate its result? public async IAs...
Pipsqueak asked 25/2, 2020 at 10:37

2

Solved

I'm sure this question is going to prove my ignorance, but I'm having a hard time understanding this. I'm willing to ask a dumb question to get a good answer. All of the posts I've read about asy...
Kirby asked 16/10, 2019 at 12:2

2

Solved

When working with an IEnumerable<T> there are the build-in extension methods from the System.Linq namespace such as Skip, Where and Select to work with. When Microsoft added IAsyncEnumerabl...
Greeting asked 14/10, 2019 at 12:15

6

Solved

Please see the below two methods. The first returns an IAsyncEnumerable. The second tries to consume it. using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using Sy...
Illfated asked 12/11, 2019 at 19:49

2

Solved

When consuming IAsyncEnumerable<T>, is it possible to just read first item from the stream and then cancel the operation and return it? Something like a FirstOrDefault on IEnumerable<T>...
Discrown asked 17/3, 2023 at 14:7

3

Solved

Function need to return Task<List<Record>> Following both options are returning Task<List<Record>>, which one is more efficient? Is there any standard way here? Option 1 : ...
Avicenna asked 16/5, 2019 at 20:30

2

We have recently migrated our ASP.NET Core API which uses Dapper to .NET Core 3.1. After the migration, we felt there was an opportunity to use the latest IAsyncEnumerable feature from C# 8 for one...
Purificator asked 28/1, 2020 at 20:35

3

Solved

With the release of Mediatr 10, there's now a paradigm that allows developers to create streams powered by IAsyncEnumerable. I'm leveraging this paradigm to create multiple different file system wa...
Defense asked 10/1, 2022 at 20:12

1

Solved

I have three controller methods returning IAsyncEnumerable of WeatherForecast. The first one #1 uses SqlConnection and yields results from an async reader. The second one #2 uses EF Core with the a...
Transmontane asked 28/11, 2021 at 20:18

2

Solved

I currently have a web API that fetches a row of data using FromSqlRaw(...).ToListAsync() within a repository returns this data as Ok(data.ToArray()) as Task<ActionResult<IEnumerable<MyCl...

1

System.Text.Json.JsonSerializer.DeserializeAsyncEnumerable<T> is a method by System.Text.Json that can take a Stream and produce an IAsyncEnumerable<T>, where the enumeration can be asy...

1

Solved

I am using a Channel<T> in a producer-consumer scenario, and I have the requirement to consume the channel in batches of 10 items each, and without letting any consumed item to stay idle in a...

0

Overview We're moving our database access to API calls and I need to return search results from a database as they're being found using that API. The plan was to use IAsyncEnumerable, but I'm havin...
Diffractive asked 2/4, 2022 at 15:6

1

Solved

I want to stream an arbitrary amount of lines of plain text from an ASP.NET server to a Blazor WebAssembly client (.NET 6.0). For testing I implemented the following dummy API: [HttpGet("lines...
Spermogonium asked 16/11, 2021 at 16:23

5

Solved

I am trying to update my toolset with the new tools offered by C# 8, and one method that seems particularly useful is a version of Task.WhenAll that returns an IAsyncEnumerable. This method should ...

2

Solved

I have an asynchronous sequence (stream) of messages that are arriving sometimes numerously and sometimes sporadically, and I would like to process them in batches of 10 messages per batch. I also ...
Mcclean asked 23/5, 2021 at 15:55

3

Solved

I have an async iterator method that produces an IAsyncEnumerable<int> (a stream of numbers), one number every 200 msec. The caller of this method consumes the stream, but wants to stop the e...
Phosphorite asked 4/10, 2019 at 10:39

4

Solved

I am using an async/await method returning IAsyncEnumerable<> to retrieve rows from a SQL Server database and provide them via a Web API .Net Core 3.0 interface. It works fine until I exceed 819...
Carrie asked 22/11, 2019 at 3:4

2

Solved

I encountered an interesting behavior while exploring IAsyncEnumerable in an ASP.NET Web API project. Consider the following code samples: // Code Sample 1 [HttpGet] public async IAsyncEnumerab...
Enjoin asked 15/11, 2019 at 12:12

2

I'm currently testing out C# 8's async streams, and it seems that when I try to run the application using the old pattern of of using async/await and returning Task> it seems to be faster. (I measu...
Montparnasse asked 16/1, 2020 at 16:21

3

Solved

I have an interface which is written like this: public interface IItemRetriever { public IAsyncEnumerable<string> GetItemsAsync(); } I want to write an empty implementation that returns n...
Hautesalpes asked 22/12, 2019 at 10:29

2

Solved

I have the following interface: public interface IValidationSystem<T> { IAsyncEnumerable<ValidationResult> ValidateAsync(T obj); } And I am trying to implement it this way: public cla...
Jetblack asked 27/1, 2021 at 10:34

1

Solved

For a while I've been trying to get my head around the whole async/await model that C# uses for asynchronous code. The addition of async streams (the IAsyncEnumerable<T> type) seemed really ...
Omaomaha asked 4/12, 2020 at 7:2

4

Solved

Its really hard to find any information on IAsyncEnumerable, other than a few mentions in the 'What's New c# 8.0' articles. Trying to use it in Visual Studio 2019 with netstandard 2.0 and C# 8 enab...
Intersperse asked 24/4, 2019 at 2:58

3

Solved

I have the following function that returns the standard output data, as an async stream, that results from running a System.Diagnostics.Process. Everything currently in the method works as intended...
Proteus asked 4/11, 2020 at 6:12

© 2022 - 2025 — McMap. All rights reserved.