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

[Feature Request] Replace System.TimeProvider in workflows #307

Open
cretz opened this issue Jul 15, 2024 · 1 comment
Open

[Feature Request] Replace System.TimeProvider in workflows #307

cretz opened this issue Jul 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@cretz
Copy link
Member

cretz commented Jul 15, 2024

Describe the solution you'd like

There is now a .NET API for creating timers and getting current time. Leverage it. See https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider. Will have to see how it may affect versions we release packages for. https://github.com/dotnet/extensions/tree/main/src/Libraries/Microsoft.Extensions.TimeProvider.Testing seems to support .NET 6 probably by way of Microsoft.Bcl.TimeProvider inclusion.

Note, while we should provide a Workflow.TimeProvider property, there does not seem to be an obvious way to change the default time provider.

@cretz cretz added the enhancement New feature or request label Jul 15, 2024
@Sushisource
Copy link
Member

there does not seem to be an obvious way to change the default time provider.

Nor should we, I think (other than to just make it throw an error), consistent with the idea that we probably want to avoid magic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants