Liking cljdoc? Tell your friends :D

wagoe.cache.shell.adapters.in-memory

In-memory cache implementation for development and testing.

Features:

  • Thread-safe operations using Clojure atoms
  • TTL support with automatic expiration
  • LRU eviction policy
  • Statistics tracking
  • Pattern matching
  • Namespace support

Suitable for:

  • Local development without Redis
  • Fast unit testing
  • CI/CD pipelines
  • Single-process applications

NOT suitable for:

  • Distributed systems (not shared across processes)
  • Production use (no persistence)
  • High-memory workloads (limited by JVM heap)
In-memory cache implementation for development and testing.

Features:
- Thread-safe operations using Clojure atoms
- TTL support with automatic expiration
- LRU eviction policy
- Statistics tracking
- Pattern matching
- Namespace support

Suitable for:
- Local development without Redis
- Fast unit testing
- CI/CD pipelines
- Single-process applications

NOT suitable for:
- Distributed systems (not shared across processes)
- Production use (no persistence)
- High-memory workloads (limited by JVM heap)
raw docstring

wagoe.cache.shell.adapters.redis

Redis-backed distributed cache implementation.

Features:

  • Distributed caching across multiple processes
  • Automatic TTL and expiration
  • Atomic operations (INCR, DECR, SETNX)
  • Pattern matching with SCAN
  • Namespace support
  • Connection pooling

Suitable for:

  • Production deployments
  • Distributed systems
  • High-availability applications
  • Microservices architecture

Redis Data Structures Used:

  • Strings: For cache values (Nippy serialized, stored as binary)
  • TTL: Built-in Redis expiration
  • Atomic ops: INCR, DECR, SETNX, etc.
Redis-backed distributed cache implementation.

Features:
- Distributed caching across multiple processes
- Automatic TTL and expiration
- Atomic operations (INCR, DECR, SETNX)
- Pattern matching with SCAN
- Namespace support
- Connection pooling

Suitable for:
- Production deployments
- Distributed systems
- High-availability applications
- Microservices architecture

Redis Data Structures Used:
- Strings: For cache values (Nippy serialized, stored as binary)
- TTL: Built-in Redis expiration
- Atomic ops: INCR, DECR, SETNX, etc.
raw docstring

wagoe.cache.shell.module-wiring

Integrant wiring for the cache module.

Supports two providers selectable via config:

  • :redis — distributed Redis-backed cache (production)
  • :in-memory — local atom-based cache (dev / tests without Redis)

Config key: :wagoe/cache Example (Redis): {:provider :redis :host "localhost" :port 6379 :default-ttl 300 :max-total 20 :max-idle 10 :min-idle 2}

Example (in-memory): {:provider :in-memory :default-ttl 300 :max-size 10000}

Integrant wiring for the cache module.

Supports two providers selectable via config:
- :redis      — distributed Redis-backed cache (production)
- :in-memory  — local atom-based cache (dev / tests without Redis)

Config key: :wagoe/cache
Example (Redis):
  {:provider :redis
   :host "localhost" :port 6379
   :default-ttl 300
   :max-total 20 :max-idle 10 :min-idle 2}

Example (in-memory):
  {:provider :in-memory
   :default-ttl 300
   :max-size 10000}
raw docstring

No vars found in this namespace.

wagoe.cache.shell.tenant-cache

Tenant-aware caching with automatic key prefixing.

This module provides tenant-scoped cache operations to prevent cache collisions between tenants in multi-tenant applications.

Key Features:

  • Automatic tenant-id prefixing for all cache keys
  • Transparent tenant context extraction from middleware
  • Compatible with all ICache implementations (Redis, in-memory)
  • No changes required to existing cache calls
  • Complete cache isolation between tenants

Usage: ;; Wrap existing cache with tenant context (def tenant-cache (create-tenant-cache cache tenant-id))

;; Use normally - keys automatically prefixed (ports/set-value! tenant-cache :user-123 user-data) ;; Actual key: "tenant:abc123:user-123"

;; Bulk operations work too (ports/set-many! tenant-cache {:user-1 data1 :user-2 data2}) ;; Keys: "tenant:abc123:user-1", "tenant:abc123:user-2"

Pattern: All cache keys are prefixed with: tenant:<tenant-id>:<original-key> Example: tenant:acme_corp:user:456

Tenant-aware caching with automatic key prefixing.

This module provides tenant-scoped cache operations to prevent cache
collisions between tenants in multi-tenant applications.

Key Features:
- Automatic tenant-id prefixing for all cache keys
- Transparent tenant context extraction from middleware
- Compatible with all ICache implementations (Redis, in-memory)
- No changes required to existing cache calls
- Complete cache isolation between tenants

Usage:
  ;; Wrap existing cache with tenant context
  (def tenant-cache (create-tenant-cache cache tenant-id))

  ;; Use normally - keys automatically prefixed
  (ports/set-value! tenant-cache :user-123 user-data)
  ;; Actual key: "tenant:abc123:user-123"

  ;; Bulk operations work too
  (ports/set-many! tenant-cache {:user-1 data1 :user-2 data2})
  ;; Keys: "tenant:abc123:user-1", "tenant:abc123:user-2"

Pattern:
  All cache keys are prefixed with: tenant:<tenant-id>:<original-key>
  Example: tenant:acme_corp:user:456
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close