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" />
                    
Directory.Packages.props
<PackageReference Include="SNS.EventChannel" />
                    
Project file
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
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=SNS.EventChannel&version=8.0.0
                    
Install as a Cake Tool

SNS.EventChannel Library

NuGet Build Status License

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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product 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.

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
8.0.0 207 4/14/2025
1.0.0 199 4/14/2025
0.0.7 208 4/14/2025
0.0.5 196 4/14/2025