Systems

vconcurrent

Higher level concurrency patterns, built on Venutian’s own spawn and await.

Released v1.0.0 · 2026-09-28
Import
use "stdlib/concurrent.ven"

Higher level concurrency patterns built on spawn and await: run work at the same time and collect the results.

vconcurrent.ven
t = spawn_one(make(x) give x * 2, 5)
print await t
:: 10
Reference (5 functions)

API reference

spawn_one(work_fn, item)

Spawns work_fn(item) as one concurrent task.

t = spawn_one(make(x) give x * 2, 5)
await t
:: 10

map_over_concurrently(items, work_fn)

Runs work_fn over every item in items concurrently, one task each.

map_over_concurrently([1, 2, 3], make(x) give x * 2)
:: [2, 4, 6]

await_all(tasks)

Awaits every task in tasks, in order.

t1 = spawn_one(make(x) give x * 2, 5)
t2 = spawn_one(make(x) give x * 2, 10)
await_all([t1, t2])
:: [10, 20]

run_with_timeout_seconds(work_fn, timeout_seconds)

run_with_timeout_seconds(make() give 42, 0.001)
:: 42

worker_pool_map(items, worker_count, work_fn)

Runs work_fn over items concurrently, in fixed-size chunks.

worker_pool_map([1, 2, 3, 4, 5], 2, make(x) give x * 2)
:: [2, 4, 6, 8, 10]

Get notified when vconcurrent changes

Get notified about

New versions and security advisories.

New and updated packages, once a day.

News on the math model built in Venutian.