Class InMemoryGenericFileIdempotentRepository

Assembly: redb.Route.GenericFile.dll

In-memory idempotent repository for tracking processed files across all file-based transports.
Tracks files by a composite key (path + last modified + size) to detect re-processing.
Thread-safe via HashSet + lock.

public sealed class InMemoryGenericFileIdempotentRepository : IIdempotentRepository

Inheritance

Object→InMemoryGenericFileIdempotentRepository

Implements

Properties

Count

Current number of tracked keys.

public int Count { get; }

Methods

Add(string, CancellationToken)

Attempts to add the key. Returns true if the key was new (not a duplicate).

public Task<bool> Add(string key, CancellationToken ct = default)

Clear(CancellationToken)

Removes all keys from the repository.

public Task Clear(CancellationToken ct = default)

Confirm(string, CancellationToken)

Confirms the key after successful processing.

public Task Confirm(string key, CancellationToken ct = default)

Contains(string, CancellationToken)

Checks if the key already exists in the repository.

public Task<bool> Contains(string key, CancellationToken ct = default)

DefaultKey(GenericFileInfo)

Generates the default idempotent key for a file.

public static string DefaultKey(GenericFileInfo file)

Remove(string, CancellationToken)

Removes the key, allowing it to be reprocessed.

public Task Remove(string key, CancellationToken ct = default)