All Projects → dotnet-campus → Asyncworkercollection

dotnet-campus / Asyncworkercollection

Licence: mit
高性能的多线程异步工具库。A collection of tools that support asynchronous methods and support high-performance multithreading.

Projects that are alternatives of or similar to Asyncworkercollection

Devchatterbot
Stars: ✭ 60 (-18.92%)
Mutual labels:  dotnet-core
Cppast.codegen
An extensible library providing C# PInvoke codegen from C/C++ files for .NET
Stars: ✭ 65 (-12.16%)
Mutual labels:  dotnet-core
Xunit Logging
Logging extensions for xunit
Stars: ✭ 69 (-6.76%)
Mutual labels:  dotnet-core
Ionic Example App
A Ionic Example App (previously known as ionic 2 examples). Contains different examples on how to use the Ionic Framework
Stars: ✭ 61 (-17.57%)
Mutual labels:  dotnet-core
Stl.fusion.samples
A collection of samples for Fusion library: https://github.com/servicetitan/Stl.Fusion
Stars: ✭ 65 (-12.16%)
Mutual labels:  dotnet-core
Poke
A powerful reflection module for powershell.
Stars: ✭ 66 (-10.81%)
Mutual labels:  dotnet-core
Dotnet Bundle
MSBuild task and CLI tools for bundling .NET Core projects into MacOS applications (.app)
Stars: ✭ 59 (-20.27%)
Mutual labels:  dotnet-core
Telegram.bot.framework
Simple framework for building Telegram bots
Stars: ✭ 73 (-1.35%)
Mutual labels:  dotnet-core
Waypoint
Opinionated solution template for building F# OSS libraries and tools.
Stars: ✭ 65 (-12.16%)
Mutual labels:  dotnet-core
Scorm Learningmanagementsystem
Open Source SCORM Learning Management System demo
Stars: ✭ 68 (-8.11%)
Mutual labels:  dotnet-core
Icanpay.donet
统一支付网关。支持NET46和NETSTANDARD2_0。支持支付宝,微信,银联支付渠道通过Web,App,Wap,QRCode方式支付。简化订单的创建、查询、退款跟接收网关返回的支付通知等功能
Stars: ✭ 62 (-16.22%)
Mutual labels:  dotnet-core
Skater .net Obfuscator
Skater .NET Obfuscator is an obfuscation tool for .NET code protection. It implements all known software protection techniques and obfuscation algorithms.
Stars: ✭ 64 (-13.51%)
Mutual labels:  dotnet-core
Enums.net
Enums.NET is a high-performance type-safe .NET enum utility library
Stars: ✭ 1,151 (+1455.41%)
Mutual labels:  dotnet-core
Aspnetboilerplate Core Ng
Tutorial for ASP.NET Boilerplate Core + Angular
Stars: ✭ 61 (-17.57%)
Mutual labels:  dotnet-core
Neo4j Dotnet Ogm
Neo4j Object Graph Mapping Library for .NET
Stars: ✭ 69 (-6.76%)
Mutual labels:  dotnet-core
Pioneer Console Boilerplate
Dependency injection, logging and configuration in a .NET Core console application.
Stars: ✭ 60 (-18.92%)
Mutual labels:  dotnet-core
Drinkandgo
A simple eCommerce App build on top of Asp.Net Core MVC framework.
Stars: ✭ 65 (-12.16%)
Mutual labels:  dotnet-core
Dotnet Template Onion
Onion Architecture with .NET 5/.NET Core and CQRS/Event Sourcing following a DDD approach
Stars: ✭ 70 (-5.41%)
Mutual labels:  dotnet-core
Grpc Demos
Demos for my talk Beyond HTTP in ASP.NET Core 3.0 with gRPC
Stars: ✭ 74 (+0%)
Mutual labels:  dotnet-core
Elf
The .NET 5 link forward service runs on Microsoft Azure
Stars: ✭ 68 (-8.11%)
Mutual labels:  dotnet-core

dotnetCampus.AsyncWorkerCollection

中文

Build NuGet

A collection of tools that support asynchronous methods and support high-performance multithreading.

Install NuGet package

Two different libraries are provided for installation.

Install the traditionary NuGet Dll library

.NET CLI:

dotnet add package dotnetCampus.AsyncWorkerCollection

PackageReference:

<PackageReference Include="dotnetCampus.AsyncWorkerCollection" Version="1.2.1" />

Install the SourceYard NuGet source code

.NET CLI:

dotnet add package dotnetCampus.AsyncWorkerCollection.Source --version 1.2.1

PackageReference:

<PackageReference Include="dotnetCampus.AsyncWorkerCollection.Source" Version="1.2.1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

Usage

AsyncQueue

An asynchronous queue that supports multiple threads

Create a queue:

  var asyncQueue = new AsyncQueue<FooTask>();

Add task to queue:

  asyncQueue.Enqueue(new FooTask());

Waiting for the task to dequeue:

  var fooTask = await asyncQueue.DequeueAsync();

The advantage of AsyncQueue over Channel is that it supports .NET Framework 45 and simple

DoubleBufferTask

DoubleBufferTask supports multi-threaded fast input data and single-threaded batch processing of data, and supports waiting for buffer execution to complete

var doubleBufferTask = new DoubleBufferTask<Foo>(list =>
{
    // Method to perform batch List<Foo> tasks
    // The incoming delegate will be called when there is data in the DoubleBufferTask, and it means that there is at least one element in the list
});

// Multiple other threads call this code to add the task data
doubleBufferTask.AddTask(new Foo());

// After the business code is completed, call the Finish method to indicate that no more tasks are added
// This Finish method is not thread-safe
doubleBufferTask.Finish();

// Other threads can call WaitAllTaskFinish to wait for the completion of all task data in DoubleBufferTask
// It will return after be Finish method be called and the all the task data be handled
await doubleBufferTask.WaitAllTaskFinish();

AsyncAutoResetEvent

Asynchronous version of AutoResetEvent lock

AsyncAutoResetEvent is functionally the same as AutoResetEvent, except that WaitOne is replaced with WaitOneAsync to support asynchronous waiting

AsyncManualResetEvent

Asynchronous version of ManualResetEvent lock

AsyncManualResetEvent is functionally the same as ManualResetEvent, except that WaitOne is replaced with WaitOneAsync to support asynchronous waiting

Benchmark

See Benchmark.md

Contributing

PRs Welcome

If you would like to contribute, feel free to create a Pull Request, or give us Bug Report.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].