Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI validation enhancements #69

Merged
merged 4 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add XML comments
  • Loading branch information
sfmskywalker committed Oct 26, 2023
commit 0a25704c77090ea0900e3909b401b50032aa8bab
21 changes: 21 additions & 0 deletions src/framework/Elsa.Studio.Core/Contracts/IMediator.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
namespace Elsa.Studio.Contracts;

/// <summary>
/// Represents a mediator that can be used to publish notifications and subscribe to notifications.
/// </summary>
public interface IMediator
{
/// <summary>
/// Subscribes to a notification.
/// </summary>
/// <param name="handler"></param>
/// <typeparam name="TNotification"></typeparam>
/// <typeparam name="THandler"></typeparam>
void Subscribe<TNotification, THandler>(THandler handler) where THandler : INotificationHandler<TNotification> where TNotification : INotification;

/// <summary>
/// Unsubscribes from a notification.
/// </summary>
void Unsubscribe<TNotification, THandler>(THandler handler) where THandler : INotificationHandler<TNotification> where TNotification : INotification;

/// <summary>
/// Unsubscribes from a notification.
/// </summary>
void Unsubscribe(INotificationHandler handler);

/// <summary>
/// Publishes a notification.
/// </summary>
Task NotifyAsync<TNotification>(TNotification notification, CancellationToken cancellationToken = default) where TNotification : INotification;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@

namespace Elsa.Studio.Workflows.Domain.Notifications;

/// <summary>
/// Represents a notification that is sent when a workflow definition is published.
/// </summary>
public record WorkflowDefinitionPublished(WorkflowDefinition WorkflowDefinition) : INotification;