Skip to content

Adopting TimeProvider in MemoryCache #114011

@ErisApps

Description

@ErisApps

Hii,

I've been using TimeProvider (and it's unit testing equivalent) for some time now and noticed recently that MemoryCache still uses the ISystemClock, which I thought was deprecated (In reality, it's most likely a copy of it's equivalent in the ASP.NET Core repo, as it's part of Microsoft.Extensions.Caching.Abstractions).

I know it's perfectly possible to just implement a proxy from ISystemClock towards TimeProvider, but I was wondering whether there were any plans to actually deprecate that remaining symbol and transition MemoryCache towards TimeProvider in the BCL altogether? Especially since HybridCache already uses TimeProvider.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions