Provides the std concurrent task package.
Package: std.concurrent.task
Reachable from entry: no
std/concurrent/cancellation.mlascancellation→ std/concurrent/cancellation.mlstd/concurrent/thread_pool.mlasthreadPool→ std/concurrent/thread_pool.mlstd/threading.mlasthreading→ std/threading.mlstd/time.mlastime→ std/time.ml
- std.concurrent.task.CancellableCall — struct
- std.concurrent.task.Future — struct
function run(pool, callback, data)Schedule a conventional one-argument callback on an existing pool.
| Parameter | Type | Default | Description |
|---|---|---|---|
pool |
dynamic |
— | Value supplied for pool. |
callback |
dynamic |
— | Value supplied for callback. |
data |
dynamic |
— | Data to process. |
Source: std/concurrent/task.ml:118
function runCancellable(pool, callback, data)Schedule callback(data, token) and return a future which can request cancel.
| Parameter | Type | Default | Description |
|---|---|---|---|
pool |
dynamic |
— | Value supplied for pool. |
callback |
dynamic |
— | Value supplied for callback. |
data |
dynamic |
— | Data to process. |
Source: std/concurrent/task.ml:128
const TASK_ERROR = 1651Track the task error value used by this standard-library module.
Source: std/concurrent/task.ml:16
function whenAll(futures)Wait for every future in input order and return the equally ordered results.
| Parameter | Type | Default | Description |
|---|---|---|---|
futures |
dynamic |
— | Value supplied for futures. |
Source: std/concurrent/task.ml:141
function whenAny(futures)Provide the when any operation for this standard-library module.
| Parameter | Type | Default | Description |
|---|---|---|---|
futures |
dynamic |
— | Value supplied for futures. |
Source: std/concurrent/task.ml:197
function whenAnyFor(futures, milliseconds)Return the first completed future index, or -1 after the timeout. A negative timeout waits indefinitely; zero performs a non-blocking observation.
| Parameter | Type | Default | Description |
|---|---|---|---|
futures |
dynamic |
— | Value supplied for futures. |
milliseconds |
dynamic |
— | Maximum duration in milliseconds. |
Source: std/concurrent/task.ml:158