Lightweight LRU pool for Candil.Engine instances.
The pool keeps a list of engines ordered from most‑recently used to
least‑recently used. Each engine is identified by its alias. The
public API mimics a simple key‑value store with LRU semantics:
start_link/0– starts the pool as a GenServer named__MODULE__.put/1– insert or update an engine, marking it as most recently used.get/0– return the least‑recently used engine and promote it to “most recently used”.evict/0– remove the least‑recently used engine from the pool and return it.
Summary
Functions
Returns a specification to start this module under a supervisor.
Evicts the least recently used engine and returns it.
Returns the least recently used engine, promoting it to MRU.
Callback implementation for GenServer.init/1.
Marks an engine as most recently used (or inserts it).
Starts the engine pool GenServer.
Types
@type engine() :: struct()
Engine struct expected by the pool
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec evict() :: engine() | :empty
Evicts the least recently used engine and returns it.
@spec get() :: engine() | :empty
Returns the least recently used engine, promoting it to MRU.
Callback implementation for GenServer.init/1.
@spec put(engine()) :: :ok
Marks an engine as most recently used (or inserts it).
Starts the engine pool GenServer.