my ziglings
0

Configure Feed

Select the types of activity you want to include in your feed.

improvements for async-io

Chris Boesch (Apr 6, 2026, 6:50 PM +0200) aeeb1893 63e50658

+10 -5
+6 -1
exercises/090_async6.zig
··· 23 23 // } 24 24 // sel.cancelDiscard(); // cancel remaining, discard results 25 25 // 26 + // As with all async primitives: tasks spawned in a Select MUST 27 + // be cleaned up. Use sel.cancel() to get remaining results one 28 + // by one (for resource cleanup), or sel.cancelDiscard() if you 29 + // don't need them. 30 + // 26 31 // The buffer must be large enough for all tasks that might 27 32 // complete before you call cancelDiscard(). 28 33 // ··· 47 52 48 53 // Wait for the first finisher. 49 54 // What Select method returns the first completed result? 50 - const winner = ???; 55 + const winner = try sel.???(); 51 56 52 57 switch (winner) { 53 58 .hare => |msg| print("Hare: {s}\n", .{msg}),
+4 -4
patches/patches/090_async6.patch
··· 1 - --- exercises/090_async6.zig 2026-04-02 10:25:34.016616118 +0200 2 - +++ answers/090_async6.zig 2026-04-02 10:27:48.827144051 +0200 3 - @@ -47,7 +47,7 @@ 1 + --- exercises/090_async6.zig 2026-04-06 18:49:37.232023422 +0200 2 + +++ answers/090_async6.zig 2026-04-06 18:49:22.189720687 +0200 3 + @@ -52,7 +52,7 @@ 4 4 5 5 // Wait for the first finisher. 6 6 // What Select method returns the first completed result? 7 - - const winner = ???; 7 + - const winner = try sel.???(); 8 8 + const winner = try sel.await(); 9 9 10 10 switch (winner) {