| ... | @@ -1173,10 +1173,19 @@ pub fn checkCancel(io: Io) Cancelable!void { | ... | @@ -1173,10 +1173,19 @@ pub fn checkCancel(io: Io) Cancelable!void { |
| 1173 | return io.vtable.checkCancel(io.userdata); | 1173 | return io.vtable.checkCancel(io.userdata); |
| 1174 | } | 1174 | } |
| 1175 | | 1175 | |
| | 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. |
| 1176 | pub fn Select(comptime U: type) type { | 1183 | pub fn Select(comptime U: type) type { |
| 1177 | return struct { | 1184 | return struct { |
| 1178 | io: Io, | 1185 | io: Io, |
| 1179 | group: Group, | 1186 | group: Group, |
| | 1187 | /// The queue is never closed because there may be live resources |
| | 1188 | /// inserted into it which would otherwise leak. |
| 1180 | queue: Queue(U), | 1189 | queue: Queue(U), |
| 1181 | | 1190 | |
| 1182 | const S = @This(); | 1191 | const S = @This(); |