diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 2d5926d9b..bb972f850 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -227,14 +227,17 @@ extension DatabaseWriter { } } -public struct Future { - private let _wait: () throws -> T +/// A future value. +public struct Future { + private let _wait: () throws -> Value - init(_ wait: @escaping () throws -> T) { + init(_ wait: @escaping () throws -> Value) { _wait = wait } - public func wait() throws -> T { + /// Blocks the current thread until the future value is available. + /// Throws an error if the value could not be computed. + public func wait() throws -> Value { return try _wait() } }