Raxol.Terminal.Cache.System (Raxol v2.0.1)
View SourceUnified caching system for the Raxol terminal emulator. This module provides a centralized caching mechanism that consolidates all caching operations across the terminal system, including:
- Buffer caching
- Animation caching
- Scroll caching
- Clipboard caching
- General purpose caching
Summary
Functions
Returns a specification to start this module under a supervisor.
Clears the cache.
Gets a value from the cache.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
Invalidates a cache entry.
Returns the current monotonic time in milliseconds. This is used for cache expiration and timing operations.
Puts a value in the cache.
Gets cache statistics.
Types
@type cache_entry() :: %{ value: cache_value(), size: non_neg_integer(), created_at: integer(), last_access: integer(), access_count: non_neg_integer(), ttl: integer() | nil, metadata: map() }
@type cache_key() :: term()
@type cache_stats() :: %{ size: non_neg_integer(), max_size: non_neg_integer(), hit_count: non_neg_integer(), miss_count: non_neg_integer(), hit_ratio: float(), eviction_count: non_neg_integer() }
@type cache_value() :: term()
@type namespace() :: :buffer | :animation | :scroll | :clipboard | :general
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Clears the cache.
Parameters
opts- Clear options:namespace- Cache namespace (default: :general)
Gets a value from the cache.
Parameters
key- The cache keyopts- Get options:namespace- Cache namespace (default: :general)
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
Invalidates a cache entry.
Parameters
key- The cache keyopts- Invalidate options:namespace- Cache namespace (default: :general)
@spec monotonic_time() :: integer()
Returns the current monotonic time in milliseconds. This is used for cache expiration and timing operations.
Puts a value in the cache.
Parameters
key- The cache keyvalue- The value to cacheopts- Put options:namespace- Cache namespace (default: :general):ttl- Time-to-live in seconds:metadata- Additional metadata
Gets cache statistics.
Parameters
opts- Stats options:namespace- Cache namespace (default: :general)