@@ -67,7 +67,7 @@ public extension LambdaHandler {
67
67
let promise = context. eventLoop. makePromise ( of: Void . self)
68
68
self . offloadQueue. async {
69
69
do {
70
- try self . syncShutdown ( )
70
+ try self . syncShutdown ( context : context )
71
71
promise. succeed ( ( ) )
72
72
} catch {
73
73
promise. fail ( error)
@@ -76,9 +76,9 @@ public extension LambdaHandler {
76
76
return promise. futureResult
77
77
}
78
78
79
- /// Clean up the `LambdaHandler` resources synchronously.
79
+ /// Clean up the Lambda resources synchronously.
80
80
/// 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 {
82
82
// noop
83
83
}
84
84
}
@@ -186,8 +186,8 @@ public protocol ByteBufferLambdaHandler {
186
186
/// The `EventLoopFuture` should be completed with either a response encoded as `ByteBuffer` or an `Error`
187
187
func handle( context: Lambda . Context , event: ByteBuffer ) -> EventLoopFuture < ByteBuffer ? >
188
188
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.
191
191
///
192
192
/// - Note: In case your Lambda fails while creating your LambdaHandler in the `HandlerFactory`, this method
193
193
/// **is not invoked**. In this case you must cleanup the created resources immediately in the `HandlerFactory`.
0 commit comments