mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-10 02:05:08 +00:00
docs: add xml comments for Essentials routing
This commit is contained in:
@@ -5,17 +5,34 @@ using Serilog.Events;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Routing
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an item in the route request queue.
|
||||
/// </summary>
|
||||
public class RouteRequestQueueItem : IQueueMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// The action to perform for the route request.
|
||||
/// </summary>
|
||||
private readonly Action<RouteRequest> action;
|
||||
/// <summary>
|
||||
/// The route request data.
|
||||
/// </summary>
|
||||
private readonly RouteRequest routeRequest;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RouteRequestQueueItem"/> class.
|
||||
/// </summary>
|
||||
/// <param name="routeAction">The action to perform.</param>
|
||||
/// <param name="request">The route request data.</param>
|
||||
public RouteRequestQueueItem(Action<RouteRequest> routeAction, RouteRequest request)
|
||||
{
|
||||
action = routeAction;
|
||||
routeRequest = request;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispatches the route request action.
|
||||
/// </summary>
|
||||
public void Dispatch()
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Dispatching route request {routeRequest}", null, routeRequest);
|
||||
@@ -23,13 +40,35 @@ namespace PepperDash.Essentials.Core.Routing
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an item in the queue for releasing a route.
|
||||
/// </summary>
|
||||
public class ReleaseRouteQueueItem : IQueueMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// The action to perform for releasing the route.
|
||||
/// </summary>
|
||||
private readonly Action<IRoutingInputs, string, bool> action;
|
||||
/// <summary>
|
||||
/// The destination device whose route is being released.
|
||||
/// </summary>
|
||||
private readonly IRoutingInputs destination;
|
||||
/// <summary>
|
||||
/// The specific input port key on the destination to release, or null/empty for any/default.
|
||||
/// </summary>
|
||||
private readonly string inputPortKey;
|
||||
/// <summary>
|
||||
/// Indicates whether to clear the route (send null) or just release the usage tracking.
|
||||
/// </summary>
|
||||
private readonly bool clearRoute;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReleaseRouteQueueItem"/> class.
|
||||
/// </summary>
|
||||
/// <param name="action">The action to perform.</param>
|
||||
/// <param name="destination">The destination device.</param>
|
||||
/// <param name="inputPortKey">The input port key.</param>
|
||||
/// <param name="clearRoute">True to clear the route, false to just release.</param>
|
||||
public ReleaseRouteQueueItem(Action<IRoutingInputs, string, bool> action, IRoutingInputs destination, string inputPortKey, bool clearRoute)
|
||||
{
|
||||
this.action = action;
|
||||
@@ -38,6 +77,9 @@ namespace PepperDash.Essentials.Core.Routing
|
||||
this.clearRoute = clearRoute;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispatches the release route action.
|
||||
/// </summary>
|
||||
public void Dispatch()
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Dispatching release route request for {destination}:{inputPortKey}", null, destination?.Key ?? "no destination", string.IsNullOrEmpty(inputPortKey) ? "auto" : inputPortKey);
|
||||
|
||||
Reference in New Issue
Block a user