clear method
Clears all items from the cache.
Removes all cached data, effectively resetting the cache to an empty state. This operation is irreversible and should be used with caution.
Implementations may throw exceptions if the clear operation fails due to underlying storage issues (e.g., disk errors).
Implementation
@override
Future<void> clear() async {
try {
await _executeCommand(['FLUSHDB']);
_stats.clears++;
} catch (e) {
throw CacheException('Failed to clear cache: $e');
}
}