14 lines
		
	
	
		
			375 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			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();
 | |
| }
 | 
