~ruther/NosSmooth.Comms

ref: b656ad15ba66742c4268df31537eda929a3dd08c NosSmooth.Comms/src/Core/NosSmooth.Comms.Abstractions/Responders/IMessageResponder.cs -rw-r--r-- 864 bytes
b656ad15 — Rutherther chore(local): update versions 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//
//  IMessageResponder.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Remora.Results;

namespace NosSmooth.Comms.Data.Responders;

/// <summary>
/// A responder to a received message from client or server.
/// </summary>
/// <typeparam name="TMessage">The type of the message to respond to.</typeparam>
public interface IMessageResponder<TMessage>
{
    /// <summary>
    /// Respond to the given message.
    /// </summary>
    /// <param name="message">The message received.</param>
    /// <param name="ct">The cancellation token used for cancelling the operation.</param>
    /// <returns>A result that may or may not have succeeded.</returns>
    public Task<Result> Respond(TMessage message, CancellationToken ct = default);
}
Do not follow this link