Async/Await Example
Demonstrates non-blocking async/await with await fetchAll for parallel HTTP fetches.
Features Used
http—fetch,fetchAll,await(native asyncmain)
Definitive Validation
cargo test -p tishlangtest_async_parallel_vs_sequential_timing --features httpCompiles parallel.tish (await fetchAll) and sequential.tish (await fetch in loop), runs both, and asserts parallel < 60% of sequential time. Uses httpbin.org/delay/1 (~1s per request): 3 parallel ≈ 1s, 3 sequential ≈ 3s.
Local Development
cargo run -p tishlang--features http -- build examples/async-await/src/main.tish -o async_demo
./async_demoPrograms
parallel.tish—await fetchAll(3× delay/1)sequential.tish—await fetchin a loop