CustomPubSub

CustomPubSub

Core abstractions for room-based pub/sub messaging in .NET.

Interfaces

public interface IMessagePublisher
{
    ValueTask PublishAsync(string room, string message, CancellationToken cancellationToken = default);
}

public interface IMessageSubscriber
{
    Task<IAsyncDisposable> SubscribeAsync(string room, Func<string, Task> handleMessageAsync, CancellationToken cancellationToken);
}

Usage

This package contains only abstractions. Install an implementation package:

  • `CustomPubSub.RabbitMq` — RabbitMQ implementation
  • `CustomPubSub.WebSocket` — ASP.NET Core WebSocket middleware

Links