theraot / Theraot

Backporting .NET and more: LINQ expressions in .net 2.0 - nuget Theraot.Core available.
MIT License
158 stars 30 forks source link

Task.CompletedTask #178

Closed OwnageIsMagic closed 2 years ago

theraot commented 2 years ago

There is a gap between the targets where Theraot.Core offers Task.CompletedTask, and the targets that has Task.CompletedTask built-in. The official Nuget https://www.nuget.org/packages/System.Threading.Tasks/4.0.11 fills that gap. And Theraot.Core avoids conflict with official Nugets (i.e. Nugets form Microsoft and dotnetframework).

OwnageIsMagic commented 2 years ago

this package contains only ref assemblies I'm targeting 4.0 and looking for TaskEx.CompletedTask

OwnageIsMagic commented 2 years ago

ok found it under TaskExEx

theraot commented 2 years ago

I think what you were looking for was the Async TCP. If I recall correctly that is how you would get TaskEx.CompletedTask. I don't know if that Async TCP remains available. Yet, I also avoided conflict with the Async TCP. which resulted in TaskExEx. And, yes, as you found out there is a TaskExEx.CompletedTask available on all targets on Theraot.Core. It is too good to not have, but Task.CompletedTask and TaskEx.CompletedTask were both possible conflicts.

OwnageIsMagic commented 2 years ago

so you are not planning to integrate this? https://github.com/microsoft/referencesource/blob/5697c29004a34d80acdaf5742d7e699022c64ecd/Microsoft.Bcl.Async/Microsoft.Threading.Tasks.Extensions.Desktop/AsyncPlatformExtensions.cs https://github.com/microsoft/referencesource/blob/5697c29004a34d80acdaf5742d7e699022c64ecd/Microsoft.Bcl.Async/Microsoft.Threading.Tasks.Extensions.Desktop/AsyncPlatformExtensions.WebClient.cs

theraot commented 2 years ago

That is correct. I'm not planning to integrate that.