SNS.EventChannel
8.0.0
dotnet add package SNS.EventChannel --version 8.0.0
NuGet\Install-Package SNS.EventChannel -Version 8.0.0
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="SNS.EventChannel" Version="8.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SNS.EventChannel" Version="8.0.0" />
<PackageReference Include="SNS.EventChannel" />
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 SNS.EventChannel --version 8.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SNS.EventChannel, 8.0.0"
#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 SNS.EventChannel@8.0.0
#: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=SNS.EventChannel&version=8.0.0
#tool nuget:?package=SNS.EventChannel&version=8.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SNS.EventChannel Library
Overview
SNS.EventChannel is a lightweight, high-performance .NET library that provides a robust event channel system for publishing to SNS asyncrounsly with retry logic in your applications. It enables loose coupling between components through asynchronous event-driven communication.
Features
- 🚀 High performance, minimal overhead event dispatching
- 🔄 Asynchronous event handling
- 🧩 Strong typing for events with generic support
- 🛡️ Thread-safe event publication
TODO
- 📊 Built-in support for dotnet metrics
Installation
Package Manager Console
Install-Package SNS.EventChannel
.NET CLI
dotnet add package SNS.EventChannel
Quick Start
Install dependencies
dotnet add package
dotnet add package polly
Define Your Event
public class OrderCreatedEvent
{
public string OrderId { get; set; }
public DateTime CreatedAt { get; set; }
public decimal Amount { get; set; }
}
Register new EventChannel in startup
builder.Services.AddEventChannel<OrderCreatedEvent>(options =>
{
options.TopicArn = "EventChannel:TopicArn";
options.MaxRetryAttempts = 3;
options.BoundedCapacity = 1_000_000;
options.UseBoundedCapacity = true; // Set to false for unbounded channel
});
Register EventRaiser in starup
builder.Services.AddEventRaiser();
Publish Events
// Publish an OrderCreatedEvent
await eventChannel.PublishAsync(new OrderCreatedEvent
{
OrderId = "ORD-12345",
CreatedAt = DateTime.UtcNow,
Amount = 99.99m
});
Advanced Usage
Configuring Event Channels
var options = new EventChannelOptions
{
MaxConcurrentHandlers = 5,
DefaultTimeout = TimeSpan.FromSeconds(30),
EnableLogging = true
};
IEventChannel eventChannel = new EventChannel(options);
Performance Considerations
SNS.EventChannel is designed with performance in mind:
- Minimal allocations during event dispatch
- Support for batched event publishing
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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.
-
net8.0
- AWSSDK.SimpleNotificationService (>= 3.7.400.133)
- Microsoft.Extensions.DependencyInjection (>= 9.0.4)
- Microsoft.Extensions.Hosting (>= 9.0.4)
- Microsoft.Extensions.Logging (>= 9.0.4)
- Polly (>= 8.5.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.