Comments (1)
@ejlevin1, the yield.Return
is not thread-safe, so the sample code certainly leads to an unpredicted behavior.
Having multiple producers and one (or multiple) consumers is a slightly more complex problem, which is discussed in issue #32.
I posted an example on StackOverflow how to implement it:
https://stackoverflow.com/questions/54402544/c-sharp-asyncenumerable-running-awaiting-multiple-tasks-never-finishes/56189780#56189780
It seems that the solution to this problem can be a good candidate for a helper/extension method.
from asyncenumerable.
Related Issues (20)
- Property-based testing HOT 2
- yield.ReturnAsync inside ParallelForEachAsync HOT 5
- .NET Core 3 / .NET Standard 2.1 HOT 10
- Take slow for large count value regardless of enumerable size HOT 3
- How to break on ParallelForEachAsync HOT 3
- Performance compared to using Task.WhenAll HOT 1
- Does not work on linux systems HOT 1
- Use the interfaces in a .NET Core 3.1 project
- Race condition in ParallelForEachAsync when exceptions are thrown HOT 3
- Change maxdegreeofparallelism during execution?
- the type IAsyncEnumerable exists in both AsyncInterfaces and interactive.async
- asyncEnumerable.ParallelForEachAsync() natively in C# 8
- Accidentally using Dasync's async methods on an EF DbSet blows up the world HOT 3
- How does ParallelForEachAsync compares to TPL's ActionBlock? HOT 1
- Using of GetAwaiter().GetResult() from ValueTask<T> in EnumeratorAdapter
- Question on requirements for build server and ncrunch
- ConfigureAwait(false) in asp.net _core_ not needed
- Using ParallelForEachAsync() for non-CPU-intensive tasks
- ParallelForEachAsync hangs when I update Microsoft.Bcl.AsyncInterfaces from 1.0.0.0 to 5.0.0.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asyncenumerable.