authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-02-20 16:57:48-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-02-20 17:08:13-08:00
logf9053f38e5ca29c23d2328ed06293727cd1fe8d4
tree02842342422eeba03f69c86db38e7f77a2df8cdd
parent54eb03cbf61a5c5fdee29c0f45cca824e13d6af8

std.Io.Select: add documentation


1 files changed, 9 insertions(+), 0 deletions(-)

lib/std/Io.zig+9
......@@ -1173,10 +1173,19 @@ pub fn checkCancel(io: Io) Cancelable!void {
11731173 return io.vtable.checkCancel(io.userdata);
11741174}
11751175
1176/// Executes tasks together, providing a mechanism to wait until one or more
1177/// tasks complete. Similar to `Batch` but operates at the higher level task
1178/// abstraction layer rather than lower level `Operation` abstraction layer.
1179///
1180/// The provided tagged union will be used as the return type of the await
1181/// function. When calling async or concurrent, one specifies which union field
1182/// the called function's result will be placed into upon completion.
11761183pub fn Select(comptime U: type) type {
11771184 return struct {
11781185 io: Io,
11791186 group: Group,
1187 /// The queue is never closed because there may be live resources
1188 /// inserted into it which would otherwise leak.
11801189 queue: Queue(U),
11811190
11821191 const S = @This();