Interface IReadLockStrategy
Abstraction for read lock strategies used by the file consumer.
Each strategy determines how to acquire and release locks on files being polled,
preventing the consumer from reading a file that is still being written.
public interface IReadLockStrategy
Methods
AcquireLock(FileInfo, FileEndpointOptions, CancellationToken)
Attempts to acquire a read lock on the file.
Task<bool> AcquireLock(FileInfo file, FileEndpointOptions options, CancellationToken ct)
GetLockedStream(string)
Read stream already held by this lock, if any. Strategies that keep an exclusive
Stream? GetLockedStream(string originalPath)
GetWorkPath(string)
Path the file occupies while this lock is held. Strategies that relocate the file
string GetWorkPath(string originalPath)
ReleaseLock(FileInfo, FileEndpointOptions)
Releases the read lock on the file after processing.
void ReleaseLock(FileInfo file, FileEndpointOptions options)