Named LIFO stacks backed by SuperCache ETS partitions.
Works transparently in both local and distributed modes — the
mode is determined by the :cluster option passed to SuperCache.start!/1.
In distributed mode, structural mutations (push, pop, get_all) are
routed to the partition's primary node.
Example
alias SuperCache.Stack
Stack.push("history", :page_a)
Stack.push("history", :page_b)
Stack.pop("history") # => :page_b
Stack.get_all("history") # => [:page_a]
Summary
Functions
Return the number of items.
Drain all items top-first. Returns [] for an empty stack.
Pop and return the top value. Returns default (nil) when empty.
Push value onto stack_name. Creates the stack if it does not exist.
Functions
@spec count( any(), keyword() ) :: non_neg_integer()
Return the number of items.
Options
:read_mode—:local(default),:primary, or:quorum.
Drain all items top-first. Returns [] for an empty stack.
Pop and return the top value. Returns default (nil) when empty.
Push value onto stack_name. Creates the stack if it does not exist.