AbyssIrc.Signals 0.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package AbyssIrc.Signals --version 0.2.1
                    
NuGet\Install-Package AbyssIrc.Signals -Version 0.2.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="AbyssIrc.Signals" Version="0.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AbyssIrc.Signals" Version="0.2.1" />
                    
Directory.Packages.props
<PackageReference Include="AbyssIrc.Signals" />
                    
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 AbyssIrc.Signals --version 0.2.1
                    
#r "nuget: AbyssIrc.Signals, 0.2.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.
#addin nuget:?package=AbyssIrc.Signals&version=0.2.1
                    
Install AbyssIrc.Signals as a Cake Addin
#tool nuget:?package=AbyssIrc.Signals&version=0.2.1
                    
Install AbyssIrc.Signals as a Cake Tool

AbyssIrc.Signals

A lightweight, high-performance event and signal management library for .NET applications.

Features

  • Asynchronous event dispatching
  • Publish/Subscribe pattern implementation
  • High-performance event processing
  • Flexible signal listener registration
  • Supports multiple event handlers
  • Configurable parallel event processing

Installation

Install the package via NuGet:

dotnet add package AbyssIrc.Signals

Quick Start

Basic Usage

// Create a signal service
var signalConfig = new AbyssIrcSignalConfig
{
    DispatchTasks = Environment.ProcessorCount
};
var signalService = new AbyssSignalService(signalConfig);

// Define an event
public record UserConnectedEvent(string Username);

// Create a listener
public class UserConnectionListener : IAbyssSignalListener<UserConnectedEvent>
{
    public async Task OnEventAsync(UserConnectedEvent signalEvent)
    {
        Console.WriteLine($"User connected: {signalEvent.Username}");
    }
}

// Subscribe to an event
signalService.Subscribe<UserConnectedEvent>(new UserConnectionListener());

// Or use a lambda
signalService.Subscribe<UserConnectedEvent>(async evt =>
{
    Console.WriteLine($"User connected: {evt.Username}");
});

// Publish an event
await signalService.PublishAsync(new UserConnectedEvent("JohnDoe"));

Core Concepts

AbyssSignalService

The central component for event management. Key methods include:

  • Subscribe<TEvent>(): Register event listeners
  • PublishAsync<TEvent>(): Dispatch events to all registered listeners
  • AllEventsObservable: Observable stream of all events

AbyssIrcSignalConfig

Configure the signal service:

var config = new AbyssIrcSignalConfig
{
    // Number of parallel dispatch tasks
    DispatchTasks = 5
};

Advanced Usage

Multiple Listeners

// Multiple listeners can handle the same event
signalService.Subscribe<UserConnectedEvent>(listener1);
signalService.Subscribe<UserConnectedEvent>(listener2);

Error Handling

The signal service handles listener exceptions, logging them without stopping event dispatching.

Performance Considerations

  • Uses System.Reactive for efficient event handling
  • Configurable parallel event processing
  • Low-overhead event dispatching

Extensibility

  • Implement IAbyssSignalListener<TEvent> for custom listeners
  • Use lambda expressions for quick event handling
  • Easily integrate with dependency injection

Dependencies

  • .NET 6.0 or later
  • System.Reactive

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

License

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

Support

  • Open an issue on GitHub for bug reports or feature requests
  • Join our community discussions

About AbyssIrc

AbyssIrc.Signals is part of the AbyssIrc ecosystem, a modern, extensible IRC server and networking library.


Note: This library is currently in active development. APIs may change between versions.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
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
0.2.3 143 7 days ago
0.2.2 78 9 days ago
0.2.1 102 10 days ago
0.2.0 107 10 days ago
0.1.15 141 11 days ago
0.1.14 138 11 days ago
0.1.9 140 11 days ago
0.1.8 143 11 days ago
0.1.7 137 12 days ago
0.1.6 136 12 days ago
0.1.5 131 12 days ago
0.1.4 125 13 days ago
0.1.3 133 14 days ago
0.1.2 131 14 days ago
0.1.1 135 14 days ago
0.1.0 117 15 days ago
0.0.23 122 15 days ago
0.0.22 120 15 days ago
0.0.21 123 15 days ago