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

clear-all!clj

(clear-all! cache)

Clear all cache entries and statistics. Useful for testing.

Args: cache - InMemoryCache instance

Clear all cache entries and statistics. Useful for testing.

Args:
  cache - InMemoryCache instance
sourceraw docstring

create-in-memory-cacheclj

(create-in-memory-cache)
(create-in-memory-cache config)

Create in-memory cache instance.

Args: config - Optional configuration map: :default-ttl - Default TTL in seconds :max-size - Maximum number of entries (LRU eviction) :track-stats? - Track hit/miss statistics (default true)

Returns: InMemoryCache instance implementing all cache protocols

Create in-memory cache instance.

Args:
  config - Optional configuration map:
           :default-ttl - Default TTL in seconds
           :max-size - Maximum number of entries (LRU eviction)
           :track-stats? - Track hit/miss statistics (default true)

Returns:
  InMemoryCache instance implementing all cache protocols
sourceraw docstring

get-all-entriesclj

(get-all-entries cache)

Get all cache entries. Useful for testing.

Args: cache - InMemoryCache instance

Returns: Map of key -> CacheEntry

Get all cache entries. Useful for testing.

Args:
  cache - InMemoryCache instance

Returns:
  Map of key -> CacheEntry
sourceraw 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