Files
wren/test/web/client_batch.wren
T
retoor 5c2269f6a7 feat: add buildmanual target, faker demo, subprocess examples, and contributing sidebar to manual
Add Makefile buildmanual target for manual generation and include faker_demo.wren, subprocess_async_demo.wren, subprocess_concurrent_demo.wren, and subprocess_fiber_demo.wren example scripts. Update manual sidebar across api pages to link new web-server tutorial and contributing section with module architecture, pure-wren/c-backed modules, foreign classes, async patterns, testing, and documentation pages.
2026-01-25 18:02:02 +00:00

26 lines
638 B
JavaScript
Vendored

// retoor <retoor@molodetz.nl>
import "scheduler" for Scheduler, Future
var items = ["a", "b", "c"]
var futures = []
for (item in items) {
futures.add(async { "processed_" + item })
}
System.print(futures.count) // expect: 3
System.print(futures[0] is Future) // expect: true
System.print(futures[1] is Future) // expect: true
System.print(futures[2] is Future) // expect: true
var results = []
for (f in futures) {
results.add(await f)
}
System.print(results.count) // expect: 3
System.print(results[0]) // expect: processed_a
System.print(results[1]) // expect: processed_b
System.print(results[2]) // expect: processed_c