RpcLoadBalancer.LoadBalancer.IndexRegistry (rpc_load_balancer v0.2.1)

Copy Markdown View Source

Assigns unique integer indices to arbitrary keys for a given cache.

Uses Cache.PersistentTerm for key-to-index mappings and :atomics for a monotonic next-index counter per cache. Indices are zero-based and never reused.

Summary

Functions

adapter_options()

cache_adapter()

cache_name()

child_spec(_)

delete(key)

get(key)

get_or_create(key, fnc)

get_or_register(cache_name, key)

@spec get_or_register(atom(), term()) :: non_neg_integer()

init_counter(cache_name)

@spec init_counter(atom()) :: :ok

put(key, ttl \\ nil, value)