Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
tomerd committed Jun 18, 2020
1 parent 245d4ab commit 9512244
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/AWSLambdaRuntimeCore/LambdaHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public extension LambdaHandler {
let promise = context.eventLoop.makePromise(of: Void.self)
self.offloadQueue.async {
do {
try self.syncShutdown()
try self.syncShutdown(context: context)
promise.succeed(())
} catch {
promise.fail(error)
Expand All @@ -76,9 +76,9 @@ public extension LambdaHandler {
return promise.futureResult
}

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

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

0 comments on commit 9512244

Please sign in to comment.