-
Notifications
You must be signed in to change notification settings - Fork 5k
Add Task.Wait(TimeSpan, CancellationToken) api #30067
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
Comments
Do you mean "overflows high ranges"? Since using Actually, I think I'm more curious what somebody's doing that would result in them having a wait of (2 ^31 - 1) / 1000 / 60 / 60 /24 = 24 days.... |
Sounds like a good idea. I was going over some code with a coworker today and they looked into using Also, in the end it became |
It is a design bug of .NET 1.0 that timeouts sometimes are expressed as |
Closing as one specific case of #14336. It'd be good to address this holistically if it's going to be addressed. |
The current api might tempt people to directly cast
TimeSpan.TotalMilliseconds
to int (guilty) without realizing that there may be super rare cases where this truncates high ranges.There is a
Task.Wait(TimeSpan)
overload to pair with theTask.Wait(int)
method so it would only be good if the same would be true forTask.Wait(int, CancellationToken)
.This came up in a review of an Npgsql PR npgsql/npgsql#2508 (comment)
The text was updated successfully, but these errors were encountered: