Retructured solution
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using LiteCharms.Features.Abstractions;
|
||||
|
||||
namespace LiteCharms.Features.ServiceBus.Abstractions;
|
||||
|
||||
public abstract class EventBusQueueBase
|
||||
{
|
||||
protected readonly Channel<IEvent> channel = Channel.CreateBounded<IEvent>(Constants.QueueBounds);
|
||||
|
||||
public ChannelWriter<IEvent> Outgoing => channel.Writer;
|
||||
|
||||
public ChannelReader<IEvent> Incoming => channel.Reader;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using LiteCharms.Features.Abstractions;
|
||||
|
||||
namespace LiteCharms.Features.ServiceBus.Abstractions;
|
||||
|
||||
public interface IEventBus
|
||||
{
|
||||
Task<Result> PublishAsync<TEvent>(TEvent notification, CancellationToken cancellationToken = default)
|
||||
where TEvent : class, IEvent;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using LiteCharms.Features.Abstractions;
|
||||
|
||||
namespace LiteCharms.Features.ServiceBus.Abstractions;
|
||||
|
||||
public interface IEventBusQueue
|
||||
{
|
||||
ChannelWriter<IEvent> Outgoing { get; }
|
||||
|
||||
ChannelReader<IEvent> Incoming { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user