# Interface IClientMessageService

Namespace
  adas_core.Application.Services.Interfaces

Assembly
  adas-core.Application.dll

    public interface IClientMessageService

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Methods

### ProcessMessage(Message, string)

Processes an incoming message within the context of the specified connection.

    Task ProcessMessage(Message msg, string contextConnectionId)

#### Parameters

`msg` Message

  The message to be processed.

`contextConnectionId` string

  The identifier of the connection context associated with the message.

#### Returns

Task

### SendAsync(string, OperationType?, object?)

Asynchronously sends a message to the specified receiver, optionally categorized by an operation type.

    Task SendAsync(string receiverId, OperationType? type, object? msg)

#### Parameters

`receiverId` string

  The identifier of the intended message receiver.

`type` OperationType?

  The optional operation type used to classify the message.

`msg` object

  The optional message payload to be sent.

#### Returns

Task

  A task that represents the asynchronous send operation.

### SendToAllAsync(OperationType, object?)

Asynchronously broadcasts a message of the specified operation type to all connected recipients.

    Task SendToAllAsync(OperationType type, object? msg)

#### Parameters

`type` OperationType

  The operation type that classifies the broadcast message.

`msg` object

  The message payload to send, or `null` when no payload is required.

#### Returns

Task

  A task that represents the asynchronous broadcast operation.

### SendUpdateMessageToBoxes(List<PatientLocation>)

Sends an update message to the specified list of patient location boxes.

    void SendUpdateMessageToBoxes(List<PatientLocation> boxes)

#### Parameters

`boxes` List<PatientLocation>

  The list of patient locations that will receive the update message.