Skip to content

Commit ccc8578

Browse files
authored
Merge pull request #23 from dotnet-campus/t/lindexi/doc-zh
加上文档
2 parents 954bf6b + e9aa035 commit ccc8578

File tree

2 files changed

+107
-1
lines changed

2 files changed

+107
-1
lines changed

README.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,74 @@
11
# dotnetCampus.AsyncWorkerCollection
22

3-
多线程异步工具
3+
[中文](README.zh-cn.md)
44

55
| Build | NuGet |
66
| -- | -- |
77
|![](https://github.com/dotnet-campus/AsyncWorkerCollection/workflows/.NET%20Core/badge.svg)|[![](https://img.shields.io/nuget/v/dotnetCampus.AsyncWorkerCollection.svg)](https://www.nuget.org/packages/dotnetCampus.AsyncWorkerCollection)|
88

9+
A collection of tools that support asynchronous methods and support high-performance multithreading.
10+
11+
## Install NuGet package
12+
13+
Two different libraries are provided for installation.
14+
15+
### Install the traditionary NuGet Dll library
16+
17+
.NET CLI:
18+
19+
```
20+
dotnet add package dotnetCampus.AsyncWorkerCollection
21+
```
22+
23+
PackageReference:
24+
25+
```xml
26+
<PackageReference Include="dotnetCampus.AsyncWorkerCollection" Version="1.2.1" />
27+
```
28+
29+
### Install the [SourceYard](https://github.com/dotnet-campus/SourceYard) NuGet source code
30+
31+
.NET CLI:
32+
33+
```
34+
dotnet add package dotnetCampus.AsyncWorkerCollection.Source --version 1.2.1
35+
```
36+
37+
PackageReference:
38+
39+
```xml
40+
<PackageReference Include="dotnetCampus.AsyncWorkerCollection.Source" Version="1.2.1">
41+
<PrivateAssets>all</PrivateAssets>
42+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
43+
</PackageReference>
44+
```
45+
46+
## Usage
47+
48+
### AsyncQueue
49+
50+
An asynchronous queue that supports multiple threads
51+
52+
Create a queue:
53+
54+
```csharp
55+
var asyncQueue = new AsyncQueue<FooTask>();
56+
```
57+
58+
Add task to queue:
59+
60+
```csharp
61+
asyncQueue.Enqueue(new FooTask());
62+
```
63+
64+
Waiting for the task to dequeue:
65+
66+
```csharp
67+
var fooTask = await asyncQueue.DequeueAsync();
68+
```
69+
70+
## Contributing
71+
72+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/dotnet-campus/AsyncWorkerCollection/pulls)
73+
74+
If you would like to contribute, feel free to create a [Pull Request](https://github.com/dotnet-campus/AsyncWorkerCollection/pulls), or give us [Bug Report](https://github.com/dotnet-campus/AsyncWorkerCollection/issues/new).

README.zh-cn.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# dotnetCampus.AsyncWorkerCollection
2+
3+
一个支持异步方法和支持高性能多线程的工具集合
4+
5+
6+
## 安装 NuGet 包
7+
8+
这个库提供了两个不同的包可以给大家安装。其中一个包是传统的 Dll 引用包。另一个包是使用 [SourceYard](https://github.com/dotnet-campus/SourceYard) 打出来的源代码包,源代码包安装之后将会引用源代码
9+
10+
### 安装传统 NuGet Dll 库
11+
12+
.NET CLI:
13+
14+
```
15+
dotnet add package dotnetCampus.AsyncWorkerCollection
16+
```
17+
18+
PackageReference:
19+
20+
```xml
21+
<PackageReference Include="dotnetCampus.AsyncWorkerCollection" Version="1.2.1" />
22+
```
23+
24+
### 安装源代码包
25+
26+
.NET CLI:
27+
28+
```
29+
dotnet add package dotnetCampus.AsyncWorkerCollection.Source --version 1.2.1
30+
```
31+
32+
PackageReference:
33+
34+
```xml
35+
<PackageReference Include="dotnetCampus.AsyncWorkerCollection.Source" Version="1.2.1">
36+
<PrivateAssets>all</PrivateAssets>
37+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
38+
</PackageReference>
39+
```
40+

0 commit comments

Comments
 (0)