Skip to content

Commit 916d2bb

Browse files
committed
Mediator base features
1 parent 2157bd8 commit 916d2bb

27 files changed

+189
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Mediator;
2+
3+
public class CounterStreamTest
4+
{
5+
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Mediator;
2+
3+
public class LoggingNotificationBehavior
4+
{
5+
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Mediator;
2+
3+
public class MultiplyByTwoRequest
4+
{
5+
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Mediator;
2+
3+
public class NotificationTest
4+
{
5+
6+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using KSFramework.Messaging.Abstraction;
2+
3+
namespace KSFramework.Messaging;
4+
5+
/// <summary>
6+
/// Represents a mediator that supports sending requests and publishing notifications.
7+
/// </summary>
8+
public interface IMediator : ISender
9+
{
10+
/// <summary>
11+
/// Publishes a notification to all registered handlers.
12+
/// </summary>
13+
/// <typeparam name="TNotification">The notification type.</typeparam>
14+
/// <param name="notification">The notification instance.</param>
15+
/// <param name="cancellationToken">Cancellation token.</param>
16+
/// <returns>A task representing the asynchronous operation.</returns>
17+
Task Publish<TNotification>(TNotification notification, CancellationToken cancellationToken = default)
18+
where TNotification : INotification;
19+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace KSFramework.Messaging.Abstraction;
2+
3+
public interface INotification
4+
{
5+
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace KSFramework.Messaging.Abstraction;
2+
3+
public interface INotificationBehavior
4+
{
5+
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace KSFramework.Messaging.Abstraction;
2+
3+
public interface INotificationHandler
4+
{
5+
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace KSFramework.Messaging.Abstraction;
2+
3+
public interface IPipelineBehavior
4+
{
5+
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace KSFramework.Messaging.Abstraction;
2+
3+
public interface IPostProcessor
4+
{
5+
6+
}

0 commit comments

Comments
 (0)