mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-06-02 07:27:33 +00:00
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:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user