Skip to content

Commit e580440

Browse files
committed
fixup
1 parent 245d4ab commit e580440

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/AWSLambdaRuntimeCore/LambdaHandler.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public extension LambdaHandler {
6767
let promise = context.eventLoop.makePromise(of: Void.self)
6868
self.offloadQueue.async {
6969
do {
70-
try self.syncShutdown()
70+
try self.syncShutdown(context: context)
7171
promise.succeed(())
7272
} catch {
7373
promise.fail(error)
@@ -76,9 +76,9 @@ public extension LambdaHandler {
7676
return promise.futureResult
7777
}
7878

79-
/// Clean up the `LambdaHandler` resources synchronously.
79+
/// Clean up the Lambda resources synchronously.
8080
/// Concrete Lambda handlers implement this method to shutdown resources like `HTTPClient`s and database connections.
81-
func syncShutdown() throws {
81+
func syncShutdown(context: Lambda.ShutdownContext) throws {
8282
// noop
8383
}
8484
}
@@ -186,8 +186,8 @@ public protocol ByteBufferLambdaHandler {
186186
/// The `EventLoopFuture` should be completed with either a response encoded as `ByteBuffer` or an `Error`
187187
func handle(context: Lambda.Context, event: ByteBuffer) -> EventLoopFuture<ByteBuffer?>
188188

189-
/// The method to clean up your resources.
190-
/// Concrete Lambda handlers implement this method to shutdown their `HTTPClient`s and database connections.
189+
/// Clean up the Lambda resources asynchronously.
190+
/// Concrete Lambda handlers implement this method to shutdown resources like `HTTPClient`s and database connections.
191191
///
192192
/// - Note: In case your Lambda fails while creating your LambdaHandler in the `HandlerFactory`, this method
193193
/// **is not invoked**. In this case you must cleanup the created resources immediately in the `HandlerFactory`.

0 commit comments

Comments
 (0)