Skip to content

Use the new TimeProvider API from .NET 8 #1070

@martintmk

Description

@martintmk

Instead of writing our own variant of IClock that allows mocking time in tests we can now leverage the TimeProvider API that will be introduced in .NET 8.

The TimeProvider will be also available in .NET Framework by referencing the new nuget package.

Until the package is ready we can just copy the implementaiton into Polly, mark all classes as internal and once the official package is ready expose ResilienceStrategyBuilderOptions.TimeProvider property.

Wit this approach we will be using unified time abstraction and also allow easy unit-testing of strategies working with time.

Metadata

Metadata

Assignees

Labels

v8Issues related to the new version 8 of the Polly library.

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions