CancellationToken Module
CancellationToken helpers — reduces boilerplate for timeout + linked patterns.
Functions and values
| Function or value |
Description
|
Full Usage:
CancellationToken.linked timeout parent
Parameters:
TimeSpan
-
The duration after which cancellation is requested.
parent : CancellationToken
-
The parent token to link with the timeout.
Returns: CancellationTokenSource * IDisposable
A tuple of the linked CTS and a disposable that cleans up both.
|
Creates a linked CTS: cancels when parent is canceled OR after timeout.
Disposes both internal CTS on dispose. Use with
|
Full Usage:
CancellationToken.linkedFrom parent
Parameters:
CancellationToken
Returns: CancellationTokenSource
Modifiers: inline |
Creates a linked CTS from a parent token (no timeout). The parent token to link from.
|
Full Usage:
CancellationToken.withTimeout timeout
Parameters:
TimeSpan
Returns: CancellationTokenSource
Modifiers: inline |
Creates a CTS that cancels after the given timeout. Use with
|
TDesu.FSharp