Documentation
¶
Overview ¶
Package rmapstate owns the mutation protocol shared by replicated maps and atomic Pool operations that write those maps alongside other Redis state.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Script ¶
Script adds a generation candidate and protocol preflight to an atomic script. The embedded Redis script retains the standard loading and hash operations.
func NewScript ¶
NewScript declares the one-based KEYS positions of every replicated map the body may mutate. Admission runs before any body command, including non-map writes, because Redis Lua errors do not roll earlier commands back. The body may call publish_map, set_map, del_map and clear_map from the shared protocol. Ordinary ARGV positions are unchanged; the candidate is appended.
func (*Script) Run ¶
func (s *Script) Run(ctx context.Context, client redis.Scripter, keys []string, args ...any) *redis.Cmd
Run appends a fresh candidate for this atomic operation. Redis retains an existing incarnation or installs this candidate on the first actual mutation. Generation uniqueness assumes independent collision-resistant ULID candidates.