- Added InMemoryTransportOptions class for configuration settings including timeouts and latency. - Developed InMemoryTransportServer class to handle connections, frame processing, and event management. - Created ServiceCollectionExtensions for easy registration of InMemory transport services. - Established project structure and dependencies for InMemory transport library. - Implemented comprehensive unit tests for endpoint discovery, connection management, request/response flow, and streaming capabilities. - Ensured proper handling of cancellation, heartbeat, and hello frames within the transport layer.
35 lines
904 B
C#
35 lines
904 B
C#
using StellaOps.Router.Common.Enums;
|
|
|
|
namespace StellaOps.Router.Common.Models;
|
|
|
|
/// <summary>
|
|
/// Payload for the Heartbeat frame sent periodically by microservices.
|
|
/// </summary>
|
|
public sealed record HeartbeatPayload
|
|
{
|
|
/// <summary>
|
|
/// Gets the instance ID.
|
|
/// </summary>
|
|
public required string InstanceId { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets the health status.
|
|
/// </summary>
|
|
public required InstanceHealthStatus Status { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets the current in-flight request count.
|
|
/// </summary>
|
|
public int InFlightRequestCount { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets the error rate (0.0 to 1.0).
|
|
/// </summary>
|
|
public double ErrorRate { get; init; }
|
|
|
|
/// <summary>
|
|
/// Gets the timestamp when this heartbeat was created.
|
|
/// </summary>
|
|
public DateTime TimestampUtc { get; init; } = DateTime.UtcNow;
|
|
}
|