ExResilience.Cache.EtsBackend (ex_resilience v0.4.0)

Copy Markdown View Source

Built-in ETS-based cache backend with TTL support.

Stores entries as {key, value, expiry_time | nil} in a named ETS table. Expired entries are lazily evicted on read and periodically swept by the owning GenServer.

Options

  • :table_name -- atom name for the ETS table. Required.
  • :sweep_interval -- interval in ms between periodic sweeps. Default: 60_000.

Summary

Functions

Removes all expired entries from the ETS table.

Functions

sweep(state)

@spec sweep(map()) :: map()

Removes all expired entries from the ETS table.

Called by the owning GenServer on each sweep tick.