using System;
using Svrnty.CQRS.Events.Abstractions.Streaming;
using Svrnty.CQRS.Events.Abstractions.Configuration;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Svrnty.CQRS.Events.Abstractions.Streaming;
///
/// Store for managing stream-specific configuration.
///
public interface IStreamConfigurationStore
{
///
/// Gets configuration for a specific stream.
///
/// The name of the stream.
/// Cancellation token.
/// The stream configuration if found; otherwise null.
Task GetConfigurationAsync(
string streamName,
CancellationToken cancellationToken = default);
///
/// Gets all stream configurations.
///
/// Cancellation token.
/// List of all stream configurations.
Task> GetAllConfigurationsAsync(
CancellationToken cancellationToken = default);
///
/// Sets or updates configuration for a stream.
///
/// The stream configuration to set.
/// Cancellation token.
Task SetConfigurationAsync(
StreamConfiguration configuration,
CancellationToken cancellationToken = default);
///
/// Deletes configuration for a stream (reverts to defaults).
///
/// The name of the stream.
/// Cancellation token.
Task DeleteConfigurationAsync(
string streamName,
CancellationToken cancellationToken = default);
///
/// Gets configurations matching a filter.
///
/// The filter predicate.
/// Cancellation token.
/// List of matching stream configurations.
Task> FindConfigurationsAsync(
Func predicate,
CancellationToken cancellationToken = default);
}