System & I/O7 exports
Raw Markdown/coro
Cooperative coroutines (spawn, await, await-all, sleep) and typed channels (channel, send, recv) backed by Tokio.
Functions & symbols#
await#
function
Awaits an async coroutine or runtime future inside `*runtime*` and returns its resolved value.
| Parameter | Type | Optional | Description |
|---|---|---|---|
future | Coro-Future | required | Coroutine or async future handle |
Returns:
Any(let res (coro/await fut))await-all#
function
Concurrently awaits all futures in `futures`, returning their results in order.
| Parameter | Type | Optional | Description |
|---|---|---|---|
futures | Array | required | Array of Coro-Future handles |
Returns:
Any(let all (coro/await-all [f1 f2]))channel#
function
Creates an async FIFO communication channel.
Returns:
Anyrecv#
function
Receives a message from channel, yielding execution until one is available.
| Parameter | Type | Optional | Description |
|---|---|---|---|
channel | Channel | required | Channel to read from |
Returns:
Anysend#
function
Sends a value into the channel.
| Parameter | Type | Optional | Description |
|---|---|---|---|
channel | Channel | required | Target channel |
message | Any | required | Value to transmit |
Returns:
Anysleep#
function
Non-blocking async sleep suspending the current task for `millis` milliseconds.
| Parameter | Type | Optional | Description |
|---|---|---|---|
millis | Int | Float | required | Milliseconds to yield |
Returns:
Any(coro/sleep 50)spawn#
function
Spawns a non-blocking asynchronous coroutine task returning a `Coro-Future` handle.
| Parameter | Type | Optional | Description |
|---|---|---|---|
fn | Func | required | Zero-argument task function |
Returns:
Any(let fut (coro/spawn (Func () (+ 20 22))))