CancellableValueTask Module
Contains a set of standard functional helper function
Table of contents
Cancellation and Exceptions
Functions and values
Function or value | Description |
Full Usage:
CancellableValueTask.getCancellationToken () ct
Parameters:
unit
ct : CancellationToken
Returns: ValueTask<CancellationToken>
The default CancellationToken.
Modifiers: inline |
Example
val tokenSource: obj
val primes: int list
val i: int
val computation: (obj -> obj)
val printfn: format: Printf.TextWriterFormat<'T> -> 'T
val ignore: value: 'T -> unit
This will print "2" 2 seconds from start, "3" 3 seconds from start, "5" 5 seconds from start, cease computation and then
followed by "Tasks Finished".
|
Other module members
Functions and values
Function or value | Description |
Full Usage:
CancellableValueTask.apply applicable cTask
Parameters:
CancellableValueTask<('input -> 'output)>
-
A function wrapped in a CancellableValueTasks
cTask : CancellableValueTask<'input>
-
The value.
Returns: CancellableValueTask<'output>
The result of the applicable.
Modifiers: inline Type parameters: 'input, 'output |
|
Full Usage:
CancellableValueTask.bind binder cTask
Parameters:
'input -> CancellableValueTask<'output>
-
The continuation.
cTask : CancellableValueTask<'input>
-
The value.
Returns: CancellableValueTask<'output>
The result of the binder.
Modifiers: inline Type parameters: 'input, 'output |
|
Full Usage:
CancellableValueTask.map mapper cTask
Parameters:
'input -> 'output
-
The continuation.
cTask : CancellableValueTask<'input>
-
The value.
Returns: CancellableValueTask<'output>
The result of the mapper wrapped in a CancellableValueTasks.
Modifiers: inline Type parameters: 'input, 'output |
|
Full Usage:
CancellableValueTask.ofUnit unitCancellableTask
Parameters:
CancellableValueTask
-
The CancellableValueTask to convert.
Returns: CancellableValueTask<unit>
a CancellableValueTask\Modifiers: inline |
|
Full Usage:
CancellableValueTask.parallelZip left right
Parameters:
CancellableValueTask<'left>
-
The left value.
right : CancellableValueTask<'right>
-
The right value.
Returns: CancellableValueTask<'left * 'right>
A tuple of the parameters passed in.
Modifiers: inline Type parameters: 'left, 'right |
|
Full Usage:
CancellableValueTask.singleton item ct
Parameters:
'item
-
The item to be the result of the CancellableValueTask.
ct : CancellationToken
Returns: ValueTask<'item>
A CancellableValueTask with the item as the result.
Modifiers: inline Type parameters: 'item |
|
Full Usage:
CancellableValueTask.toUnit cancellableTask ct
Parameters:
CancellableValueTask<'a>
ct : CancellationToken
Returns: ValueTask
a CancellableValueTask.
Modifiers: inline Type parameters: 'a |
|
Full Usage:
CancellableValueTask.zip left right
Parameters:
CancellableValueTask<'left>
-
The left value.
right : CancellableValueTask<'right>
-
The right value.
Returns: CancellableValueTask<'left * 'right>
A tuple of the parameters passed in
Modifiers: inline Type parameters: 'left, 'right |
|