Dispatch

Redis Store

High-throughput Redis store for ephemeral and latency-sensitive Dispatch workloads.

The store/redis package implements Dispatch's store interfaces using Grove KV backed by the Redis driver. Jobs use Sorted Sets as priority queues, events use Streams, and all entities are stored as JSON via Grove KV.

Usage

import (
    "github.com/xraph/grove/kv"
    "github.com/xraph/grove/kv/drivers/redisdriver"
    "github.com/xraph/dispatch/store/redis"
)

kvStore, err := kv.Open(redisdriver.Open("redis://localhost:6379/0"))
if err != nil {
    log.Fatal(err)
}

s := redis.New(kvStore)
if err := s.Ping(ctx); err != nil {
    log.Fatal(err)
}

d, err := dispatch.New(dispatch.WithStore(s))

Internals

AspectDetail
DriverGrove KV + redisdriver
MigrationsNo-op (schemaless)
Data structuresSorted Sets for job queues, Streams for events, JSON for entities
Pingkv.Ping(ctx)
CloseNo-op -- caller owns the *kv.Store lifecycle

When to use

  • High-throughput, low-latency job processing.
  • Ephemeral workloads where persistence is not critical.
  • Environments already running Redis for caching or pub/sub.

On this page