Connected.Common/Common/Documents/IDocumentLocker.cs
2022-12-07 14:05:43 +01:00

14 lines
375 B
C#

namespace Common.Documents;
public interface IDocumentLocker<TDocument, TPrimaryKey> : IDisposable
where TDocument : IDocument<TPrimaryKey>
where TPrimaryKey : notnull
{
event EventHandler? Expired;
Guid Key { get; }
TimeSpan LockTimeout { get; set; }
TimeSpan Timeout { get; set; }
TimeSpan Lifetime { get; set; }
Task Lock(TDocument document);
Task Unlock();
}