vs-threading
Open.ChannelExtensions
vs-threading | Open.ChannelExtensions | |
---|---|---|
8 | 4 | |
955 | 324 | |
1.2% | 4.3% | |
9.4 | 6.4 | |
1 day ago | 4 days ago | |
C# | C# | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
vs-threading
-
when to use pascal case (FirstName) or prefix underscore camel case (_firstName) when declaring an attirbutes inside class?
There is also an official MS analyzer for Async code, it has rules like avoid async void, don't use synchronous .Wait() or .Result etc. One of them is to use Async suffix, as per guidelines.
-
Implementing an Async Mutex
Any idea how this compares to what Visual Studio is doing: https://github.com/microsoft/vs-threading/blob/main/src/Microsoft.VisualStudio.Threading/AsyncSemaphore.cs
-
Is there a way to force an `async` computation / `MailboxProcessor` to use a unique thread?
Searching for SingleThreadedSynchronizationContext led me to Microsoft.VisualStudio.Threading. Is this library only intended for use with Visual Studio or is it also useful for working with other native and COM applications?
-
What NuGet packages do you automatically add
It looks like 2 of them, ya (although personally I'm on .NET Framework to minimize dependency file sizes). But there are many others, from catching async void (https://github.com/microsoft/vs-threading/blob/main/doc/analyzers/index.md ), to catching unsealed classes (small performance benefits, so why not), etc.
-
How would you fix this sync-over-async code?
Take a look at the JoinableTaskFactory in this library: https://github.com/microsoft/vs-threading
- Reentrant (Recursive) Async Lock is Impossible in C#
-
Prevent deadlock while calling async method inside synchronous one (inside environment with synchronization context)
I'd recommend a look at https://github.com/microsoft/vs-threading (don't worry about the name, you can use it outside of VS environment too).
-
C# Async fire and forget with error handling
All these concerns, and more, are why we in the Visual Studio team wrote the vs-threading library and its JoinableTaskFactory. We have a doc section on fire and forget and shutdown concerns just like you were asking about. If you follow the guidance, the way to wait on outstanding tasks at shutdown is as simple as:
Open.ChannelExtensions
-
System.Threading.Channels Golang switch Equivalent?
Open. ChannelExtensions
-
Best way to process large amount of Tasks?
Low level channels is always a bit messy for me. The ChannelExtensions library is the way to go for me, the code is much cleaner.
-
C# experience from a perspective of a Scala Developer.
For streaming you should look into channels. The built in functionality is a bit too low level to be immediately useful, but if you use the ChannelExtensions library https://github.com/Open-NET-Libraries/Open.ChannelExtensions it's very easy to work with IAsynEnumerable and do things like batching, merging and transforming.
- Open.ChannelExtensions v5.1.0: Batching can now have a timeout.
What are some alternatives?
.NET Runtime - .NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
ezThread - Library for easy threading tasks
AsyncBridge - A library to help bridge C# async method execution from synchronous methods, such as in Windows Forms and ASP.NET.
lib12 - lib12 is a library of universal helpers and extensions useful in any .NET project
AsyncLock - An async/await-friendly lock for .NET, complete with asynchronous waits, safe reèˆntrance, and more.
AsyncEnumerable - Defines IAsyncEnumerable, IAsyncEnumerator, ForEachAsync(), ParallelForEachAsync(), and other useful stuff to use with async-await
AspNetIdentity - ASP.NET Identity for ASP.NET 4.x applications
AsyncAwaitBestPractices - Extensions for System.Threading.Tasks.Task and System.Threading.Tasks.ValueTask
Rx.NET - The Reactive Extensions for .NET
language-ext - C# functional language extensions - a base class library for functional programming
RabbitMQ.Dataflows - A set of libraries for rapidly developing RabbitMQ workflows/pipelines.
ASP.NET Core - ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.