tracking

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tracking implements server-assisted client-side caching (CLIENT TRACKING). The server remembers which keys each client has read; when one of them changes, it pushes an "invalidate" message so the client can drop its local copy. With BCAST, clients instead get invalidations for every key matching their prefixes, without the server remembering reads.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Push(v resp.Value) bool
	ClientID() int64
}

type Options

type Options struct {
	BCast    bool
	Prefixes []string
	NoLoop   bool // don't notify a client about its own writes
}

type Table

type Table struct {
	// contains filtered or unexported fields
}

func New

func New(db *store.DB) *Table

func (*Table) Disable

func (t *Table) Disable(c Client)

Disable stops tracking for c. Remembered keys are cleaned lazily.

func (*Table) Enable

func (t *Table) Enable(c Client, opts Options)

func (*Table) Enabled

func (t *Table) Enabled(c Client) bool

func (*Table) Remember

func (t *Table) Remember(c Client, keys []string)

Remember records that c read keys (called after read commands).

func (*Table) TrackedKeys

func (t *Table) TrackedKeys() int

TrackedKeys returns how many keys are being tracked (for INFO).

Jump to

Keyboard shortcuts

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