Skip to content

Conversation

@ig-sinicyn
Copy link
Contributor

@ig-sinicyn ig-sinicyn commented Feb 8, 2020

  • Code.CanBeCanceled() assertion. Useful for methods that require valid cancellation token.
  • WaitForCancellationAsync() extension method. Safely waits for cancellation token without throwing an OperationCanceledException.
  • TimeoutHelper. By convention, all FW methods accepts only one special value for infinite timeout: Timeout.InfiniteTimespan (-1 ms). Methods in TimespanHelper allows to replace negative (or default) values with this special value and to apply upper limit for timeout values.
  • WithTimeout() methods. Allows to await for task with timeout. RunWiithTimeout() adds cancellation of running task on timeout.

@ig-sinicyn ig-sinicyn force-pushed the feature/with-timeout branch from 2aa1b30 to e6069b8 Compare February 8, 2020 21:10
+ WaitForCancellationAsync() extension method
+ TimeoutHelper
+ WithTimeout() methods
@ig-sinicyn ig-sinicyn force-pushed the feature/with-timeout branch from 8515a70 to 9917950 Compare February 9, 2020 12:17
@ig-sinicyn ig-sinicyn merged commit 6c02259 into master Feb 9, 2020
@ig-sinicyn ig-sinicyn deleted the feature/with-timeout branch February 9, 2020 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants