mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 01:04:43 +01:00
std.Io.Select: add documentation
This commit is contained in:
parent
54eb03cbf6
commit
f9053f38e5
1 changed files with 9 additions and 0 deletions
|
|
@ -1173,10 +1173,19 @@ pub fn checkCancel(io: Io) Cancelable!void {
|
|||
return io.vtable.checkCancel(io.userdata);
|
||||
}
|
||||
|
||||
/// Executes tasks together, providing a mechanism to wait until one or more
|
||||
/// tasks complete. Similar to `Batch` but operates at the higher level task
|
||||
/// abstraction layer rather than lower level `Operation` abstraction layer.
|
||||
///
|
||||
/// The provided tagged union will be used as the return type of the await
|
||||
/// function. When calling async or concurrent, one specifies which union field
|
||||
/// the called function's result will be placed into upon completion.
|
||||
pub fn Select(comptime U: type) type {
|
||||
return struct {
|
||||
io: Io,
|
||||
group: Group,
|
||||
/// The queue is never closed because there may be live resources
|
||||
/// inserted into it which would otherwise leak.
|
||||
queue: Queue(U),
|
||||
|
||||
const S = @This();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue