| ... | @@ -467,6 +467,7 @@ pub const OperateTimeoutError = Cancelable || Timeout.Error || ConcurrentError; | ... | @@ -467,6 +467,7 @@ pub const OperateTimeoutError = Cancelable || Timeout.Error || ConcurrentError; |
| 467 | | 467 | |
| 468 | /// Performs one `Operation` with provided `timeout`. | 468 | /// Performs one `Operation` with provided `timeout`. |
| 469 | pub fn operateTimeout(io: Io, operation: Operation, timeout: Timeout) OperateTimeoutError!Operation.Result { | 469 | pub fn operateTimeout(io: Io, operation: Operation, timeout: Timeout) OperateTimeoutError!Operation.Result { |
| | 470 | if (timeout == .none) return io.vtable.operate(io.userdata, operation); |
| 470 | var storage: [1]Operation.Storage = undefined; | 471 | var storage: [1]Operation.Storage = undefined; |
| 471 | var batch: Batch = .init(&storage); | 472 | var batch: Batch = .init(&storage); |
| 472 | batch.addAt(0, operation); | 473 | batch.addAt(0, operation); |
| ... | @@ -1147,6 +1148,7 @@ pub const Duration = struct { | ... | @@ -1147,6 +1148,7 @@ pub const Duration = struct { |
| 1147 | | 1148 | |
| 1148 | /// Declares under what conditions an operation should return `error.Timeout`. | 1149 | /// Declares under what conditions an operation should return `error.Timeout`. |
| 1149 | pub const Timeout = union(enum) { | 1150 | pub const Timeout = union(enum) { |
| | 1151 | /// `.none` will wait forever |
| 1150 | none, | 1152 | none, |
| 1151 | duration: Clock.Duration, | 1153 | duration: Clock.Duration, |
| 1152 | deadline: Clock.Timestamp, | 1154 | deadline: Clock.Timestamp, |