// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace Squidex.Infrastructure.EventSourcing { public interface IEventStore { Task> GetEventsAsync(string streamName, long streamPosition = 0); Task GetEventsAsync(Func callback, string streamFilter = null, string position = null, CancellationToken cancellationToken = default(CancellationToken)); Task AppendEventsAsync(Guid commitId, string streamName, ICollection events); Task AppendEventsAsync(Guid commitId, string streamName, long expectedVersion, ICollection events); IEventSubscription CreateSubscription(IEventSubscriber subscriber, string streamFilter, string position = null); } }