Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConcurrentLfu time-based expiry #516

Merged
merged 34 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions BitFaster.Caching.UnitTests/Lfu/TimerWheelTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BitFaster.Caching.Lfu;
using BitFaster.Caching.Lru;
using BitFaster.Caching.Scheduler;
using FluentAssertions;
using Xunit;

namespace BitFaster.Caching.UnitTests.Lfu
{
public class TimerWheelTests
{
[Fact]
public void Test()
{
var wheel = new TimerWheel<int, int, TimeOrderNode<int, int>, ExpireAfterPolicy<int, int>>();
var policy = new ExpireAfterPolicy<int, int>(wheel);
var cache = new ConcurrentLfuCore<int, int, TimeOrderNode<int, int>, ExpireAfterPolicy<int, int>>(
Defaults.ConcurrencyLevel, 3, new ThreadPoolScheduler(), EqualityComparer<int>.Default, () => { }, policy);

wheel.Should().NotBeNull();
}
}
}
2 changes: 2 additions & 0 deletions BitFaster.Caching/ItemRemovedReason.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@
/// The item was removed from the cache by a trim method call.
/// </summary>
Trimmed,

Expired,

Check warning on line 34 in BitFaster.Caching/ItemRemovedReason.cs

View workflow job for this annotation

GitHub Actions / infer

Missing XML comment for publicly visible type or member 'ItemRemovedReason.Expired'

Check warning on line 34 in BitFaster.Caching/ItemRemovedReason.cs

View workflow job for this annotation

GitHub Actions / linux

Missing XML comment for publicly visible type or member 'ItemRemovedReason.Expired'

Check warning on line 34 in BitFaster.Caching/ItemRemovedReason.cs

View workflow job for this annotation

GitHub Actions / bench-win

Missing XML comment for publicly visible type or member 'ItemRemovedReason.Expired'

Check warning on line 34 in BitFaster.Caching/ItemRemovedReason.cs

View workflow job for this annotation

GitHub Actions / bench-macos

Missing XML comment for publicly visible type or member 'ItemRemovedReason.Expired'

Check warning on line 34 in BitFaster.Caching/ItemRemovedReason.cs

View workflow job for this annotation

GitHub Actions / bench-linux

Missing XML comment for publicly visible type or member 'ItemRemovedReason.Expired'

Check warning on line 34 in BitFaster.Caching/ItemRemovedReason.cs

View workflow job for this annotation

GitHub Actions / mac

Missing XML comment for publicly visible type or member 'ItemRemovedReason.Expired'

Check warning on line 34 in BitFaster.Caching/ItemRemovedReason.cs

View workflow job for this annotation

GitHub Actions / win

Missing XML comment for publicly visible type or member 'ItemRemovedReason.Expired'
}
}
Loading
Loading