40 lines
2.2 KiB
C#
40 lines
2.2 KiB
C#
using adas_core.Domain.Enums;
|
|
using adas_core.Domain.Models;
|
|
using adas_core.Domain.Models.SignalR;
|
|
|
|
namespace adas_core.Application.Services.Interfaces;
|
|
|
|
public interface IClientMessageService
|
|
{
|
|
/// <summary>
|
|
/// Asynchronously sends a message to the specified receiver, optionally categorized by an operation type.
|
|
/// </summary>
|
|
/// <param name="receiverId">The identifier of the intended message receiver.</param>
|
|
/// <param name="type">The optional operation type used to classify the message.</param>
|
|
/// <param name="msg">The optional message payload to be sent.</param>
|
|
/// <returns>A task that represents the asynchronous send operation.</returns>
|
|
/// <!-- aidoc:v1 sig=3c62336 -->
|
|
Task SendAsync(string receiverId, OperationType? type, object? msg);
|
|
/// <summary>
|
|
/// Asynchronously broadcasts a message of the specified operation type to all connected recipients.
|
|
/// </summary>
|
|
/// <param name="type">The operation type that classifies the broadcast message.</param>
|
|
/// <param name="msg">The message payload to send, or <c>null</c> when no payload is required.</param>
|
|
/// <returns>A task that represents the asynchronous broadcast operation.</returns>
|
|
/// <!-- aidoc:v1 sig=e5d4ff6 -->
|
|
Task SendToAllAsync(OperationType type, object? msg);
|
|
/// <summary>
|
|
/// Processes an incoming message within the context of the specified connection.
|
|
/// </summary>
|
|
/// <param name="msg">The message to be processed.</param>
|
|
/// <param name="contextConnectionId">The identifier of the connection context associated with the message.</param>
|
|
/// <!-- aidoc-review:v1 severity=medium kind=missing_returns
|
|
/// "Method returns Task (indicating asynchronous processing) but no <returns> tag is present to describe the returned task." -->
|
|
Task ProcessMessage(Message msg, string contextConnectionId);
|
|
/// <summary>
|
|
/// Sends an update message to the specified list of patient location boxes.
|
|
/// </summary>
|
|
/// <param name="boxes">The list of patient locations that will receive the update message.</param>
|
|
/// <!-- aidoc:v1 sig=4a52d06 -->
|
|
void SendUpdateMessageToBoxes(List<PatientLocation> boxes);
|
|
} |