I wonder whether there are any use cases for Task.Delay(-1)
or Task.Delay(TimeSpan.FromMilliseconds(-1))
. According to respective documentations, that methods create tasks that wait indefinitely before completing. I know that await Task.Delay(...)
does not block a thread nor consumes much resources, but I cannot think of any scenario when wasting some resources is actually useful.
My question is specifically about overloads of Task.Deley()
without cancellation token - overloads that include cancellation token might be a bit more useful as the wait period can be interrupted.
Am I missing some use cases for tasks that wait indefinitely? Are they there only for consistency between method overloads?