ProtoPromise 2.1.0
See the version list below for details.
Requires NuGet 2.5 or higher.
dotnet add package ProtoPromise --version 2.1.0
NuGet\Install-Package ProtoPromise -Version 2.1.0
<PackageReference Include="ProtoPromise" Version="2.1.0" />
paket add ProtoPromise --version 2.1.0
#r "nuget: ProtoPromise, 2.1.0"
// Install ProtoPromise as a Cake Addin #addin nuget:?package=ProtoPromise&version=2.1.0 // Install ProtoPromise as a Cake Tool #tool nuget:?package=ProtoPromise&version=2.1.0
Robust and efficient library for management of asynchronous operations.
- Allocation-free async operations
- Cancelable operations with custom allocation-free CancelationToken/Source
- Progress with universal automatic or manual normalization
- Full causality traces
- Interoperable with Tasks and Unity's Coroutines
- Thread safe
- .Then API and async/await
- Easily switch to foreground or background context
- Combine async operations
- CLS compliant
This library was built to work in all C#/.Net ecosystems, including Unity, Mono, .Net Framework, .Net Core, UI frameworks, and AOT compilation. It is CLS compliant, so it is not restricted to only C#, and will work with any .Net language.
ProtoPromise conforms to the Promises/A+ Spec as far as is possible with C# (using static typing instead of dynamic), and further extends it to support Cancelations and Progress.
This library took inspiration from ES6 Promises (javascript), RSG Promises (C#), uPromise (C#/Unity), TPL, and UniTask (C#/Unity).
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 is compatible. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 3.5
- No dependencies.
-
.NETFramework 4.0
- No dependencies.
-
.NETFramework 4.5
- No dependencies.
-
.NETFramework 4.7
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net5.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ProtoPromise:
Package | Downloads |
---|---|
ProtoPromise.UnityHelpers.2018.3
ProtoPromise helpers for UnityEngine. |
|
ProtoPromise.UnityHelpers.2023.1
ProtoPromise helpers for UnityEngine. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.2.0 | 152 | 11/3/2024 |
3.1.1 | 552 | 8/17/2024 |
3.1.0 | 212 | 6/30/2024 |
3.0.2 | 636 | 4/12/2024 |
3.0.1 | 273 | 4/6/2024 |
3.0.0 | 296 | 3/18/2024 |
2.7.0 | 1,047 | 2/11/2024 |
2.6.1 | 1,089 | 10/22/2023 |
2.6.0 | 378 | 10/2/2023 |
2.5.4 | 610 | 6/17/2023 |
2.5.3 | 605 | 6/9/2023 |
2.5.2 | 567 | 6/5/2023 |
2.5.1 | 547 | 5/27/2023 |
2.5.0 | 581 | 5/15/2023 |
2.4.1 | 780 | 2/6/2023 |
2.4.0 | 838 | 12/23/2022 |
2.3.0 | 979 | 9/25/2022 |
2.2.0 | 753 | 8/6/2022 |
2.1.0 | 734 | 6/20/2022 |
2.0.2 | 766 | 4/25/2022 |
2.0.1 | 785 | 4/7/2022 |
2.0.0 | 782 | 3/7/2022 |
Enhancements:
- Added `AsyncLocal<T>` support in `async Promise` functions.
- Disabled by default, enable with `Promise.Config.AsyncFlowExecutionContextEnabled = true`.
- Added `ValueTask(<T>)` interoperability.
- Use `promise.AsValueTask()` or implicit cast `ValueTask valueTask = promise;`, or `valueTask.ToPromise()`.
- Added `System.Threading.CancellationToken` interoperability.
- Use `token.ToCancelationToken()` to convert to `Proto.Promises.CancelationToken`, or `token.ToCancellationToken()` to convert to `System.Threading.CancellationToken`.
Optimizations:
- 2x - 3x performance improvement for promises and cancelation tokens.
- Reduced memory consumption of pending promises.
Misc:
- Added netstandard2.1, netcoreapp2.1, and net5.0 build targets.
v2.0.2:
| Method | Registrations | Pending | Mean | Error | Allocated | Survived |
|------------------------ |-------------- |-------- |-----------:|---------:|----------:|---------:|
| CancelationRegistration | 10 | ? | 2,995.1 ns | 20.43 ns | - | 320 B |
| AsyncAwait | ? | False | 871.7 ns | 1.79 ns | - | - |
| ContinueWith | ? | False | 925.1 ns | 1.20 ns | - | - |
| AsyncAwait | ? | True | 6,478.1 ns | 27.46 ns | - | 864 B |
| ContinueWith | ? | True | 5,981.1 ns | 32.83 ns | - | 560 B |
v2.1.0:
| Method | Registrations | Pending | Mean | Error | Allocated | Survived |
|------------------------ |-------------- |-------- |-----------:|---------:|----------:|---------:|
| CancelationRegistration | 10 | ? | 920.3 ns | 3.05 ns | - | 560 B |
| AsyncAwait | ? | False | 344.4 ns | 2.88 ns | - | - |
| ContinueWith | ? | False | 483.0 ns | 8.55 ns | - | - |
| AsyncAwait | ? | True | 2,207.4 ns | 7.98 ns | - | 736 B |
| ContinueWith | ? | True | 2,574.5 ns | 18.50 ns | - | 416 B |