77 lines
2.6 KiB
C#
77 lines
2.6 KiB
C#
using System;
|
|
using Svrnty.CQRS.Events.Abstractions.Streaming;
|
|
using Svrnty.CQRS.Events.Abstractions.Delivery;
|
|
using Svrnty.CQRS.Events.Abstractions.Models;
|
|
using Svrnty.CQRS.Events.Abstractions.Configuration;
|
|
|
|
namespace Svrnty.CQRS.Events.Abstractions.Streaming;
|
|
|
|
/// <summary>
|
|
/// Configuration for an event stream.
|
|
/// Defines storage semantics, delivery guarantees, scope, and retention policies.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Stream configuration determines how events are stored, delivered, and retained.
|
|
/// Phase 1 focuses on basic configuration; additional properties will be added in later phases.
|
|
/// </para>
|
|
/// </remarks>
|
|
public interface IStreamConfiguration
|
|
{
|
|
/// <summary>
|
|
/// Name of the stream.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Stream names should be descriptive and unique within the application.
|
|
/// Common patterns: "{entity}-events", "{workflow-name}", "{domain}-stream"
|
|
/// </remarks>
|
|
string StreamName { get; }
|
|
|
|
/// <summary>
|
|
/// Type of stream storage (Ephemeral or Persistent).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Default: <see cref="StreamType.Ephemeral"/> for Phase 1.
|
|
/// Persistent streams will be fully implemented in Phase 2.
|
|
/// </remarks>
|
|
StreamType Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// Delivery guarantee semantics (AtMostOnce, AtLeastOnce, ExactlyOnce).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Default: <see cref="DeliverySemantics.AtLeastOnce"/> (recommended for most scenarios).
|
|
/// ExactlyOnce will be fully implemented in Phase 3.
|
|
/// </remarks>
|
|
DeliverySemantics DeliverySemantics { get; set; }
|
|
|
|
/// <summary>
|
|
/// Visibility scope (Internal or CrossService).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Default: <see cref="StreamScope.Internal"/> (secure by default).
|
|
/// CrossService will be fully implemented in Phase 4 with RabbitMQ support.
|
|
/// </remarks>
|
|
StreamScope Scope { get; set; }
|
|
|
|
/// <summary>
|
|
/// Retention policy for persistent streams (how long events are kept).
|
|
/// Only applies to persistent streams; ignored for ephemeral streams.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Default: null (no retention policy, keep events forever).
|
|
/// Retention policies will be fully implemented in Phase 2.
|
|
/// </remarks>
|
|
TimeSpan? Retention { get; set; }
|
|
|
|
/// <summary>
|
|
/// Whether event replay is enabled for this stream.
|
|
/// Only applies to persistent streams; ignored for ephemeral streams.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Default: false for Phase 1.
|
|
/// Replay functionality will be fully implemented in Phase 2.
|
|
/// </remarks>
|
|
bool EnableReplay { get; set; }
|
|
}
|