CancellableTask Module
Table of contents
Cancellation and Exceptions
Functions and values
Function or value | Description |
Full Usage:
CancellableTask.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:
CancellableTask.apply applicable cTask
Parameters:
CancellableTask<('input -> 'output)>
-
A function wrapped in a CancellableTasks
cTask : CancellableTask<'input>
-
The value.
Returns: CancellableTask<'output>
The result of the applicable.
Modifiers: inline Type parameters: 'input, 'output |
|
||||
Full Usage:
CancellableTask.bind binder cTask
Parameters:
'input -> CancellableTask<'output>
-
The continuation.
cTask : CancellableTask<'input>
-
The value.
Returns: CancellableTask<'output>
The result of the binder.
Modifiers: inline Type parameters: 'input, 'output |
|
||||
Full Usage:
CancellableTask.map mapper cTask
Parameters:
'input -> 'output
-
The continuation.
cTask : CancellableTask<'input>
-
The value.
Returns: CancellableTask<'output>
The result of the mapper wrapped in a CancellableTasks.
Modifiers: inline Type parameters: 'input, 'output |
|
||||
Full Usage:
CancellableTask.ofUnit unitCancellableTask
Parameters:
CancellableTask
-
The CancellableTask to convert.
Returns: CancellableTask<unit>
a CancellableTask\Modifiers: inline |
|
||||
Full Usage:
CancellableTask.parallelZip left right
Parameters:
CancellableTask<'left>
-
The left value.
right : CancellableTask<'right>
-
The right value.
Returns: CancellableTask<'left * 'right>
A tuple of the parameters passed in.
Modifiers: inline Type parameters: 'left, 'right |
|
||||
Full Usage:
CancellableTask.sequential tasks
Parameters:
CancellableTask<'a> seq
-
The tasks to wait on for completion
Returns: CancellableTask<'a array>
A CancellableTask that represents the completion of all of the supplied tasks.
Modifiers: inline Type parameters: 'a |
Creates a CancellableTask that will complete when all of the CancellableTasks in an enumerable collection have completed sequentially.
|
||||
Full Usage:
CancellableTask.singleton item arg2
Parameters:
'item
-
The item to be the result of the CancellableTask.
arg1 : CancellationToken
Returns: Task<'item>
A CancellableTask with the item as the result.
Modifiers: inline Type parameters: 'item |
|
||||
Full Usage:
CancellableTask.toUnit ctask ct
Parameters:
CancellableTask<'a>
-
The CancellableTask to convert.
ct : CancellationToken
Returns: Task
a CancellableTask.
Modifiers: inline Type parameters: 'a |
|
||||
Full Usage:
CancellableTask.whenAll tasks
Parameters:
CancellableTask<'a> seq
-
The tasks to wait on for completion
Returns: CancellableTask<'a[]>
A CancellableTask that represents the completion of all of the supplied tasks.
Modifiers: inline Type parameters: 'a |
Creates a task that will complete when all of the CancellableTask in an enumerable collection have completed.
|
||||
Full Usage:
CancellableTask.whenAllThrottled maxDegreeOfParallelism tasks
Parameters:
int
-
The maximum number of tasks to run concurrently.
tasks : CancellableTask<'a> seq
-
The tasks to wait on for completion
Returns: CancellableTask<'a[]>
A CancellableTask that represents the completion of all of the supplied tasks.
Modifiers: inline Type parameters: 'a |
Creates a task that will complete when all of the CancellableTask in an enumerable collection have completed.
|
||||
Full Usage:
CancellableTask.zip left right
Parameters:
CancellableTask<'left>
-
The left value.
right : CancellableTask<'right>
-
The right value.
Returns: CancellableTask<'left * 'right>
A tuple of the parameters passed in
Modifiers: inline Type parameters: 'left, 'right |
|