OgEx.Cache.ETS (og_ex v0.3.0)

Copy Markdown View Source

Default in-memory generated-image cache.

The table is local to one BEAM node and is removed when its owner stops. It does not evict entries or coalesce concurrent misses.

Summary

Functions

Returns a specification to start this module under a supervisor.

Retrieves an image directly from ETS, returning :error when absent.

Creates the concurrent-read ETS table owned by the cache process.

Inserts or replaces an encoded image in the ETS cache.

Starts the process that owns the named ETS image table.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

fetch(key)

Retrieves an image directly from ETS, returning :error when absent.

init(options)

Creates the concurrent-read ETS table owned by the cache process.

This is the GenServer initialization callback.

put(key, image)

Inserts or replaces an encoded image in the ETS cache.

start_link(options \\ [])

Starts the process that owns the named ETS image table.