Help us shape the future of Go! Take the 2026 Go Developer Survey

rmapstate

package
v1.10.0-alpha.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 6 Imported by: 0

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

func ValidName

func ValidName(name string) bool

ValidName reports whether a replicated-map name is accepted before allocation or protocol admission. Constructors that coordinate maps use the same rule.

Types

type Script

type Script struct {
	*redis.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

func NewScript(mapKeys []int, body string) *Script

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL