Task Module
Task combinators — map, bind, zip, catch, and more for Task{T}.
All functions are inline for zero-overhead abstractions. Thread-safe by design.
Functions and values
| Function or value |
Description
|
Full Usage:
fireAndForget onError f
Parameters:
exn -> unit
-
Callback invoked with the exception if the task faults.
f : unit -> Task
-
Factory that produces the task to run.
Modifiers: inline |
Fire-and-forget: starts a task without awaiting. Logs exceptions via onError. onError should not throw; if it does, the exception is silently swallowed.
|
|
Synchronously gets the result of a Task (ConfigureAwait false). The task whose result to retrieve.
|
|
|
Full Usage:
parallelThrottle maxConcurrent items f
Parameters:
int
-
Maximum number of tasks allowed to run concurrently.
items : 'T seq
-
The input sequence of items to process. Null is treated as empty.
f : 'T -> Task<'TResult>
-
Async function applied to each item.
Returns: Task<'TResult[]>
|
Runs tasks in parallel with a throttle (max concurrent). Returns all results.
A null items
sequence is treated as empty (returns an empty array).
The semaphore is guaranteed to outlive every task that can still call
|
Full Usage:
parallelThrottleUnit maxConcurrent items f
Parameters:
int
-
Maximum number of tasks allowed to run concurrently.
items : 'T seq
-
The input sequence of items to process. Null is treated as empty.
f : 'T -> Task<unit>
-
Async function applied to each item.
Returns: Task<unit>
|
Runs tasks in parallel with a throttle, ignoring results. Same null-input and semaphore-lifetime guarantees as parallelThrottle: a null items sequence is treated as empty, and the semaphore is disposed only after every spawned task has been drained, even if the loop itself throws.
|
Full Usage:
runSynchronously t
Parameters:
'a
|
Blocks until the task completes (ConfigureAwait false). No-op if null or already completed. The task to wait on.
|
|
|
|
|
|
TDesu.FSharp