Redis (rediskv)
A Redis-backed kv.Store for shared coordinator state.
The rediskv plugin implements the generic kv.Store over Redis, so the
coordinator's shared cluster state — the
worker registry, load table, and session affinity — lives in Redis instead of a
single process's memory. This is what lets multiple worker nodes share placement
state.
Capabilities
kv.Store backend (TTL + prefix list)
Install & import
import "github.com/webdeveloperben/agents-go/plugins/rediskv"No build tag.
Construct a store
func New(cfg Config) (*Store, error)
func NewWithClient(client redis.UniversalClient) *StoreNew builds the client from a Config; NewWithClient wraps a Redis client you
already own (cluster, sentinel, custom pool). Hand the resulting kv.Store to the
coordinator in place of the in-memory default.
store, err := rediskv.New(rediskv.Config{ /* addr, credentials, ... */ })
// coordinator.New(store, ...)When you need it
The default in-memory store is fine for the single-binary MVP. Reach for
rediskv when you run more than one worker node and need them to share
registry/load/affinity state. See Scaling & load.
Caveats
kv.Store is a deliberately small abstraction (get/set with TTL, prefix list) —
the coordinator layers cluster semantics on top; the backend stays generic, so no
Redis specifics leak into the SDK core.
Related
- Scaling & load — the coordinator that uses it.
- Architecture