EventStreamLib 1.1.1

dotnet add package EventStreamLib --version 1.1.1
                    
NuGet\Install-Package EventStreamLib -Version 1.1.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="EventStreamLib" Version="1.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EventStreamLib" Version="1.1.1" />
                    
Directory.Packages.props
<PackageReference Include="EventStreamLib" />
                    
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 EventStreamLib --version 1.1.1
                    
#r "nuget: EventStreamLib, 1.1.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 EventStreamLib@1.1.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=EventStreamLib&version=1.1.1
                    
Install as a Cake Addin
#tool nuget:?package=EventStreamLib&version=1.1.1
                    
Install as a Cake Tool
EventStream

EventStream is a distributed, event-driven library built with Redis for .NET.
It enables seamless event consumption and processing in a distributed system, utilizing Redis for real-time event handling.
Ideal for projects requiring scalable and efficient event-driven architectures.

Features
  • Event-Based Architecture � Efficiently consume and process events in real-time.
  • Redis Integration � Leverages Redis for reliable and high-performance event streaming.
  • Background Worker Support � Handles events through workers running in the background for seamless processing.
  • Scalable and Distributed � Built for distributed systems to scale with ease.
  • Multiple Consumer Support � One event can be consumed by multiple consumers in parallel.
  • Retry Mechanism with Dead Letter Queue (DLQ)
    In case of failure during message publish, the message is stored in a Dead Letter Queue.
    A background service reattempts publishing the message.
    This ensures that no event is lost and can be retried later.
Installation

You can install EventStream via NuGet Package Manager:

dotnet add package EventStream
Setup / Injection

Register the EventStream library and automatically discover event handlers from your assembly:

builder.Services.AddSingleton<IConnectionMultiplexer>(ConnectionMultiplexer.Connect("localhost:6379"));

builder.Services.AddStreamBus(AssemblyReference.Assembly);
Publishing Events

You can publish any event that implements the IStreamEvent interface:

public class ExampleService(IStreamService _streamService)
{
    public async void SendEventAsync()
    {
        await _streamService.PublishEventAsync(
            new ExampleStreamEvent("data"),       // event
            "eventStreamApiPublisher",            // stream enum
            40                                    // expiration minutes
        );
    }
}
appsettings.json Configuration

Configuration required for connecting and consuming Redis streams:

"StreamConfigs": {
  "StreamKey": "eventStreamApiPublisher",
  "GroupName": "group-name",
  "ConsumerName": "consumer-name"
}
Creating an Event

Every event must implement the IStreamEvent interface:

public class ExampleStreamEvent : IStreamEvent
{
    public string exampleTest { get; set; }

    public ExampleStreamEvent(string exampleTest)
    {
        this.exampleTest = exampleTest;
    }
}
Creating Event Handlers
You can define multiple handlers for the same event:
public class ExampleStreamEventHandler : IStreamEventHandler<ExampleStreamEvent>
{
    public async Task StreamHandler(ExampleStreamEvent @event)
    {
        Console.WriteLine(@event.exampleTest + " EventStream.Api.Consumer(1)");
    }
}

public class ExampleStreamEventHandler2 : IStreamEventHandler<ExampleStreamEvent>
{
    public async Task StreamHandler(ExampleStreamEvent @event)
    {
        Console.WriteLine(@event.exampleTest + " EventStream.Api.Consumer(2)");
    }
}

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

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.1.1 145 5/27/2025
1.1.0 139 5/27/2025 1.1.0 is deprecated.
1.0.9 146 5/27/2025
1.0.8 79 5/9/2025
1.0.7 148 3/18/2025
1.0.6 148 3/18/2025
1.0.5 163 3/12/2025
1.0.4 186 3/10/2025

Initial release with basic Redis event streaming support.