Wjybxx.Commons.Concurrent
1.6.1
dotnet add package Wjybxx.Commons.Concurrent --version 1.6.1
NuGet\Install-Package Wjybxx.Commons.Concurrent -Version 1.6.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Wjybxx.Commons.Concurrent" Version="1.6.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wjybxx.Commons.Concurrent" Version="1.6.1" />
<PackageReference Include="Wjybxx.Commons.Concurrent" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Wjybxx.Commons.Concurrent --version 1.6.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Wjybxx.Commons.Concurrent, 1.6.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Wjybxx.Commons.Concurrent@1.6.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Wjybxx.Commons.Concurrent&version=1.6.1
#tool nuget:?package=Wjybxx.Commons.Concurrent&version=1.6.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Concurrent模块
- 提供了Java的Executor和Future框架,并提供了对应的await语法支持。
- 提供了基于Disruptor的高性能EventLoop实现。
- 提供了ValueFutureTask -- 类比系统库的ValueTask。
版本号同步
注意:Wjybxx.Commons.Core,Wjybxx.Commons.Inject,Wjybxx.Commons.Concurrent 三个程序集的版本号总是保持一致,任一程序集修改,其它程序集版本号也会修改。
C#系统并发库缺陷
个人使用C#系统库有几点很难受:
- 系统库的Task其实是Future,这个名字的误导性很强,概念混淆。
- await语法不支持显式传参,回调线程是根据ThreadLocal的【同步上下文】(SyncContext)确定的;await还会隐式捕获【执行上下文】(ExecutionContext);
- await隐式捕获上下文,导致的结果是:简单的问题更加简单,复杂的问题更加复杂。
- Task不支持死锁检测
- TaskCompletionSource泛型类和非泛型类之间是非继承的,我们确实统一的Api获取结果和取消任务。
ReleaseNotes
1.6.x
- fix PromiseTask等未完全回收的问题
- fix Promise打印取消操作的日志
- fix ForwardFuture封装泄漏问题
1.5.0
- 撤销1.4.x中取消令牌的挪动,取消令牌重新挪回Concurrent包。
1.4.0
- <s>取消令牌相关接口挪至Commons.Core程序集,使得行为树程序集可实现
ICancelToken</s>。 - 取消令牌监听器管理优化,及时从监听器列表删除被取消的回调,避免内存泄漏问题。
1.3.x
EventLoop模块化,大幅增强DisruptorEventLoop。IFuture取消对上下文的类型约束,默认为object。ValueFuture{T}增加装箱支持,await可抑制异常抛出 --IFuture亦支持。ValueFuture的异常传递优化,避免频繁Catch再恢复。ValueFuture转IFuture时保留工作线程,帮助死锁检测。PromiseTask,SchedulePromiseTask加入池化逻辑。CancelTokenSource监听优化,监听节点Completion池化。SchedulePromiseTask周期性任务支持通过异常返回结果。
PS: 1.3.x未发布正式版,因为Commons.Core这期间升级了版本。
1.2.1
升级commons.core依赖
1.2.0
C#的异常派发机制和java不同,之前的future异常处理是按照java写的,导致异步任务的异常信息堆栈丢失。
1.1.1 ~ 1.1.2
DisruptorEventLoop适配Disruptor模块的等待超时修改。- fix
ValueFuture的await错误。 - 增加
GlobalEventLoop和ManualResetPromise。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Wjybxx.Commons.Core (>= 1.6.1)
- Wjybxx.Disruptor (>= 1.2.2)
-
net8.0
- Wjybxx.Commons.Core (>= 1.6.1)
- Wjybxx.Disruptor (>= 1.2.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.6.1 | 115 | 3/27/2026 | |
| 1.6.0 | 140 | 1/11/2026 | |
| 1.5.0 | 298 | 10/8/2025 | |
| 1.5.0-rc2 | 229 | 6/29/2025 | |
| 1.5.0-rc1 | 271 | 6/14/2025 | |
| 1.4.2 | 275 | 5/25/2025 | |
| 1.4.1 | 172 | 5/24/2025 | |
| 1.4.0 | 220 | 5/23/2025 | |
| 1.4.0-rc2 | 222 | 5/19/2025 | |
| 1.4.0-rc1 | 195 | 5/18/2025 | |
| 1.3.0-rc2 | 315 | 5/15/2025 | |
| 1.3.0-rc1 | 234 | 5/6/2025 | |
| 1.2.1 | 214 | 11/7/2024 | |
| 1.2.0 | 254 | 9/7/2024 | |
| 1.1.2 | 292 | 8/25/2024 | |
| 1.1.1 | 312 | 8/23/2024 | |
| 1.1.0 | 292 | 8/21/2024 | |
| 1.1.0-rc3 | 157 | 7/31/2024 | |
| 1.1.0-rc1 | 191 | 7/14/2024 | |
| 1.0.15 | 240 | 6/29/2024 |
Loading failed