LemonCore. Dedupe. Ets
(lemon_core v0.1.0)
View Source
Simple TTL-based deduplication backed by ETS.
Stores {key, ts_ms} entries in an ETS :set table, where ts_ms is the
monotonic time (ms) when the key was marked.
TTL semantics:
- A key is considered "seen" if
now_ms - ts_ms <= ttl_ms. - Expired entries are deleted on access (and can also be cleaned in bulk).
Summary
Functions
Combined check + mark operation.
Best-effort cleanup of entries older than ttl_ms.
Ensure the ETS table exists.
Mark a key as seen.
Check whether a key has been seen within ttl_ms.
Types
Functions
Combined check + mark operation.
Returns :seen if the key is currently within TTL, otherwise marks it and returns :new.
@spec cleanup_expired(table(), integer()) :: non_neg_integer()
Best-effort cleanup of entries older than ttl_ms.
Ensure the ETS table exists.
If table is an atom, a named table is created.
Mark a key as seen.
Check whether a key has been seen within ttl_ms.
Deletes expired entries.