@@ -38,15 +38,15 @@ public protocol LambdaHandler: EventLoopLambdaHandler {
38
38
/// - context: Runtime `Context`.
39
39
///
40
40
/// - Returns: A Lambda result ot type `Out`.
41
- func handle( event: In , context: Lambda . Context ) async throws -> Out
41
+ func handle( _ event: In , context: Lambda . Context ) async throws -> Out
42
42
}
43
43
44
44
@available ( macOS 12 , iOS 15 , tvOS 15 , watchOS 8 , * )
45
45
extension LambdaHandler {
46
- public func handle( event: In , context: Lambda . Context ) -> EventLoopFuture < Out > {
46
+ public func handle( _ event: In , context: Lambda . Context ) -> EventLoopFuture < Out > {
47
47
let promise = context. eventLoop. makePromise ( of: Out . self)
48
48
promise. completeWithTask {
49
- try await self . handle ( event: event , context: context)
49
+ try await self . handle ( event, context: context)
50
50
}
51
51
return promise. futureResult
52
52
}
@@ -82,7 +82,7 @@ public protocol EventLoopLambdaHandler: ByteBufferLambdaHandler {
82
82
///
83
83
/// - Returns: An `EventLoopFuture` to report the result of the Lambda back to the runtime engine.
84
84
/// The `EventLoopFuture` should be completed with either a response of type `Out` or an `Error`
85
- func handle( event: In , context: Lambda . Context ) -> EventLoopFuture < Out >
85
+ func handle( _ event: In , context: Lambda . Context ) -> EventLoopFuture < Out >
86
86
87
87
/// Encode a response of type `Out` to `ByteBuffer`
88
88
/// Concrete Lambda handlers implement this method to provide coding functionality.
@@ -106,15 +106,15 @@ public protocol EventLoopLambdaHandler: ByteBufferLambdaHandler {
106
106
extension EventLoopLambdaHandler {
107
107
/// Driver for `ByteBuffer` -> `In` decoding and `Out` -> `ByteBuffer` encoding
108
108
@inlinable
109
- public func handle( event: ByteBuffer , context: Lambda . Context ) -> EventLoopFuture < ByteBuffer ? > {
109
+ public func handle( _ event: ByteBuffer , context: Lambda . Context ) -> EventLoopFuture < ByteBuffer ? > {
110
110
let input : In
111
111
do {
112
112
input = try self . decode ( buffer: event)
113
113
} catch {
114
114
return context. eventLoop. makeFailedFuture ( CodecError . requestDecoding ( error) )
115
115
}
116
116
117
- return self . handle ( event : input, context: context) . flatMapThrowing { output in
117
+ return self . handle ( input, context: context) . flatMapThrowing { output in
118
118
do {
119
119
return try self . encode ( allocator: context. allocator, value: output)
120
120
} catch {
@@ -148,7 +148,7 @@ public protocol ByteBufferLambdaHandler {
148
148
///
149
149
/// - Returns: An `EventLoopFuture` to report the result of the Lambda back to the runtime engine.
150
150
/// The `EventLoopFuture` should be completed with either a response encoded as `ByteBuffer` or an `Error`
151
- func handle( event: ByteBuffer , context: Lambda . Context ) -> EventLoopFuture < ByteBuffer ? >
151
+ func handle( _ event: ByteBuffer , context: Lambda . Context ) -> EventLoopFuture < ByteBuffer ? >
152
152
153
153
/// Clean up the Lambda resources asynchronously.
154
154
/// Concrete Lambda handlers implement this method to shutdown resources like `HTTPClient`s and database connections.
0 commit comments