Skip to content

Commit 63786a9

Browse files
committed
feat: Add async_test.prox example demonstrating async/await functionality and include trace_log.txt.
1 parent 9f4429f commit 63786a9

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

examples/async_test.prox

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// async_test.pxpl
2+
3+
async func add(a, b) {
4+
return a + b;
5+
}
6+
7+
async func mainAsync() {
8+
print("Start Async");
9+
var t1 = add(10, 20);
10+
print("Task created");
11+
var res = await t1;
12+
print("Result: " + res);
13+
}
14+
15+
func main() {
16+
print("Main Sync");
17+
var t = mainAsync();
18+
await t; // Sync await (blocking)
19+
print("Done");
20+
}

trace_log.txt

7.03 KB
Binary file not shown.

0 commit comments

Comments
 (0)