Renamed completeWithAsync to completeWithTask (#221)

* Renamed EventLoopPromise's `completeWithAsync` to `completeWithTask` (based on the SwiftNIO renaming)
* Updated swift-nio dependency to 2.32.0
This commit is contained in:
Joel Saltzman
2021-08-19 09:23:53 +02:00
committed by GitHub
parent 48dc507d26
commit 245674cd6b
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ let package = Package(
.library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.30.0")),
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.32.0")),
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.2")),
.package(url: "https://github.com/swift-server/swift-backtrace.git", .upToNextMajor(from: "1.2.3")),
],
@@ -115,7 +115,7 @@ public protocol AsyncLambdaHandler: EventLoopLambdaHandler {
extension AsyncLambdaHandler {
public func handle(context: Lambda.Context, event: In) -> EventLoopFuture<Out> {
let promise = context.eventLoop.makePromise(of: Out.self)
promise.completeWithAsync {
promise.completeWithTask {
try await self.handle(event: event, context: context)
}
return promise.futureResult
@@ -127,7 +127,7 @@ extension AsyncLambdaHandler {
public static func main() {
Lambda.run { context -> EventLoopFuture<ByteBufferLambdaHandler> in
let promise = context.eventLoop.makePromise(of: ByteBufferLambdaHandler.self)
promise.completeWithAsync {
promise.completeWithTask {
try await Self(context: context)
}
return promise.futureResult