Cachex v3.1.0 Cachex.Services.Locksmith.Queue View Source

Transaction queue backing a cache instance.

This has to live outside of the Cachex.Services.Locksmith global process as otherwise caches would then compete with each other for resources which is far from optimal.

Each cache will therefore have their own queue process, represented in this module, and will operate using the utilities provided in the main Locksmith service module (rather than using this module directly).

Link to this section Summary

Functions

Executes a function in a lock-free context

Starts the internal server process backing this queue

Executes a function in a transactional context

Link to this section Functions

Link to this function execute(cache, func) View Source
execute(Spec.cache(), (() -> any())) :: any()

Executes a function in a lock-free context.

Link to this function start_link(cache) View Source
start_link(Spec.cache()) :: [GenServer.on_start()]

Starts the internal server process backing this queue.

This is little more than starting a GenServer process using this module, although it does use the provided cache record to name the new server.

Link to this function transaction(cache, keys, func) View Source
transaction(Spec.cache(), [any()], (() -> any())) :: any()

Executes a function in a transactional context.