Skip to content

Commit

Permalink
Add docstrings to server event router
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolajlauridsen committed Dec 11, 2024
1 parent cb61209 commit 8f2c62d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Umbraco.Cms.Api.Management.ServerEvents;

/// <inheritdoc />
internal sealed class ServerEventRouter : IServerEventRouter
{
private readonly IHubContext<ServerEventHub, IServerEventHub> _eventHub;
Expand All @@ -12,6 +13,7 @@ public ServerEventRouter(
IHubContext<ServerEventHub, IServerEventHub> eventHub) =>
_eventHub = eventHub;

/// <inheritdoc/>
public Task RouteEventAsync(ServerEvent serverEvent)
=> _eventHub.Clients.Group(serverEvent.EventSource.ToString()).notify(serverEvent);
}
8 changes: 8 additions & 0 deletions src/Umbraco.Core/ServerEvents/IServerEventRouter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

namespace Umbraco.Cms.Core.ServerEvents;

/// <summary>
/// Routes server events to the correct users.
/// </summary>
public interface IServerEventRouter
{
/// <summary>
/// Route a server event the users that has permissions to see it.
/// </summary>
/// <param name="serverEvent">The server event to route.</param>
/// <returns></returns>
Task RouteEventAsync(ServerEvent serverEvent);
}

0 comments on commit 8f2c62d

Please sign in to comment.