cache_group

command
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

README

CacheGroup Example

This example shows how to create multiple caches that share one bounded background runtime through daramjwee.NewGroup(...).

It demonstrates:

  • one shared CacheGroup
  • two caches with different tier layouts
  • group-level runtime options via WithGroup...
  • per-cache runtime tuning via WithWeight(...) and WithQueueLimit(...)

Run

From this directory:

go run .

Expected flow:

  1. create one shared runtime with WithGroupWorkers(2)
  2. create a users cache with mem -> file
  3. create a reports cache with file only
  4. fetch one value through each cache
  5. schedule background refresh on both caches

The example uses only local temporary directories and does not require any external service.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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