@@ -33,10 +33,10 @@ public protocol LambdaHandler: EventLoopLambdaHandler {
3333 ///
3434 /// - parameters:
3535 /// - context: Runtime `Context`.
36- /// - payload: Payload of type `In` representing the event or request.
36+ /// - event: Event of type `In` representing the event or request.
3737 /// - callback: Completion handler to report the result of the Lambda back to the runtime engine.
3838 /// The completion handler expects a `Result` with either a response of type `Out` or an `Error`
39- func handle( context: Lambda . Context , payload : In , callback: @escaping ( Result < Out , Error > ) -> Void )
39+ func handle( context: Lambda . Context , event : In , callback: @escaping ( Result < Out , Error > ) -> Void )
4040}
4141
4242internal extension Lambda {
@@ -52,11 +52,11 @@ public extension LambdaHandler {
5252 /// `LambdaHandler` is offloading the processing to a `DispatchQueue`
5353 /// This is slower but safer, in case the implementation blocks the `EventLoop`
5454 /// Performance sensitive Lambdas should be based on `EventLoopLambdaHandler` which does not offload.
55- func handle( context: Lambda . Context , payload : In ) -> EventLoopFuture < Out > {
55+ func handle( context: Lambda . Context , event : In ) -> EventLoopFuture < Out > {
5656 let promise = context. eventLoop. makePromise ( of: Out . self)
5757 // FIXME: reusable DispatchQueue
5858 self . offloadQueue. async {
59- self . handle ( context: context, payload : payload , callback: promise. completeWith)
59+ self . handle ( context: context, event : event , callback: promise. completeWith)
6060 }
6161 return promise. futureResult
6262 }
@@ -80,11 +80,11 @@ public protocol EventLoopLambdaHandler: ByteBufferLambdaHandler {
8080 ///
8181 /// - parameters:
8282 /// - context: Runtime `Context`.
83- /// - payload: Payload of type `In` representing the event or request.
83+ /// - event: Event of type `In` representing the event or request.
8484 ///
8585 /// - Returns: An `EventLoopFuture` to report the result of the Lambda back to the runtime engine.
8686 /// The `EventLoopFuture` should be completed with either a response of type `Out` or an `Error`
87- func handle( context: Lambda . Context , payload : In ) -> EventLoopFuture < Out >
87+ func handle( context: Lambda . Context , event : In ) -> EventLoopFuture < Out >
8888
8989 /// Encode a response of type `Out` to `ByteBuffer`
9090 /// Concrete Lambda handlers implement this method to provide coding functionality.
@@ -107,12 +107,12 @@ public protocol EventLoopLambdaHandler: ByteBufferLambdaHandler {
107107
108108public extension EventLoopLambdaHandler {
109109 /// Driver for `ByteBuffer` -> `In` decoding and `Out` -> `ByteBuffer` encoding
110- func handle( context: Lambda . Context , payload : ByteBuffer ) -> EventLoopFuture < ByteBuffer ? > {
111- switch self . decodeIn ( buffer: payload ) {
110+ func handle( context: Lambda . Context , event : ByteBuffer ) -> EventLoopFuture < ByteBuffer ? > {
111+ switch self . decodeIn ( buffer: event ) {
112112 case . failure( let error) :
113113 return context. eventLoop. makeFailedFuture ( CodecError . requestDecoding ( error) )
114114 case . success( let `in`) :
115- return self . handle ( context: context, payload : `in`) . flatMapThrowing { out in
115+ return self . handle ( context: context, event : `in`) . flatMapThrowing { out in
116116 switch self . encodeOut ( allocator: context. allocator, value: out) {
117117 case . failure( let error) :
118118 throw CodecError . responseEncoding ( error)
@@ -159,11 +159,11 @@ public protocol ByteBufferLambdaHandler {
159159 ///
160160 /// - parameters:
161161 /// - context: Runtime `Context`.
162- /// - payload : The event or request payload encoded as `ByteBuffer`.
162+ /// - event : The event or input payload encoded as `ByteBuffer`.
163163 ///
164164 /// - Returns: An `EventLoopFuture` to report the result of the Lambda back to the runtime engine.
165165 /// The `EventLoopFuture` should be completed with either a response encoded as `ByteBuffer` or an `Error`
166- func handle( context: Lambda . Context , payload : ByteBuffer ) -> EventLoopFuture < ByteBuffer ? >
166+ func handle( context: Lambda . Context , event : ByteBuffer ) -> EventLoopFuture < ByteBuffer ? >
167167}
168168
169169private enum CodecError : Error {
0 commit comments