CSharp8Beta.AsyncIteratorPrerequisites.Unofficial NuGet Package

This package was not created by Microsoft but the source code used to compile the assembly contained within it was written by Microsoft employees.
I hope I haven't caused any drama or broken any laws, but when C# 8 Beta was released alongside Visual Studio 2019 Preview 1, on the December 4th 2018, writing async iterators and consuming them wasn't possible even though it could have been.

The compiler was missing two types: ManualResetValueTaskSourceLogic<T> and IStrongBox<T> which I found here: https://gist.github.com/jcouv/ae7800985e3a8700bb84c6650d25bb69 and put in this nuget package within their designated namespaces. Adding this nuget package will allow you to use C# 8 Beta and write async iterators (methods which generate IAsyncEnumerable<T>).

Furthermore the bug around enumerators ending after two iterations if you're inside an async iterator method can be resolved by turning your foreach statement into an await foreach statement and applying the thin wrapper .ToAsync() on the target enumerable (which will only allocate 2 class instances, one for the call itself and one for the enumeration itself).




Got any CSharp8Beta.AsyncIteratorPrerequisites.Unofficial Question?





Info

Version: 1.1.0
Author(s): Eduard Dumitru
Last Update: Friday, December 7, 2018
.NET Fiddle: Create the first Fiddle
NuGet Url: https://www.nuget.org/packages/CSharp8Beta.AsyncIteratorPrerequisites.Unofficial


Install
Install-Package CSharp8Beta.AsyncIteratorPrerequisites.Unofficial
dotnet add package CSharp8Beta.AsyncIteratorPrerequisites.Unofficial
paket add CSharp8Beta.AsyncIteratorPrerequisites.Unofficial
CSharp8Beta.AsyncIteratorPrerequisites.Unofficial Download (Unzip the "nupkg" after downloading)





STATS

must-have-score

avg-downloads-per-day

0

days-since-last-release

2386