Open.AsyncToolkit offers a set of focused interfaces and implementations for common asynchronous programming patterns. The libraries follow interface segregation principles to enable precise dependency injection and composability.
Package | Description | NuGet |
---|---|---|
Open.AsyncToolkit.KeyValue | Core library providing foundational building blocks for asynchronous key-value operations | |
Open.AsyncToolkit.BlobStorage | Composable interfaces for blob storage operations | |
Open.AsyncToolkit.HashedRepository | Content-addressable storage built on top of the foundational interfaces |
All packages in Open.AsyncToolkit are built using a foundation of small, focused interfaces that can be composed to create more complex functionality:
- Interface Segregation: Granular interfaces allow for precise dependency injection
- Composability: Mix and match components to build custom solutions
- Testability: Easily mock dependencies in unit tests
// Only depend on the operations you actually need
public class UserProfileService
{
private readonly IReadAsync<string, UserProfile> _profileReader;
private readonly IUpdateAsync<string, UserProfile> _profileUpdater;
public UserProfileService(
IReadAsync<string, UserProfile> profileReader,
IUpdateAsync<string, UserProfile> profileUpdater)
{
_profileReader = profileReader;
_profileUpdater = profileUpdater;
}
public async Task<UserProfile> GetUserProfileAsync(string userId)
=> await _profileReader.ReadAsync(userId);
public async Task UpdateUserEmailAsync(string userId, string newEmail)
{
var profile = await _profileReader.ReadAsync(userId);
profile.Email = newEmail;
await _profileUpdater.UpdateAsync(userId, profile);
}
}
- Async-first design: Built around ValueTask-based async patterns for high performance
- Cross-platform: Works on all .NET platforms supporting .NET Standard 2.0, 2.1, and .NET 9
- Modern C# features: Utilizes the latest C# language features
- Well-tested: Comprehensive test coverage ensures reliability
This project is licensed under the MIT License - see the LICENSE file for details.