@@ -26,7 +26,7 @@ package protocol StreamingLambdaHandler {
2626 /// - event: The invocation's input data.
2727 /// - responseWriter: A ``LambdaResponseStreamWriter`` to write the invocation's response to.
2828 /// If no response or error is written to `responseWriter` an error will be reported to the invoker.
29- /// - context: The ``NewLambdaContext `` containing the invocation's metadata.
29+ /// - context: The ``LambdaContext `` containing the invocation's metadata.
3030 /// - Throws:
3131 /// How the thrown error will be handled by the runtime:
3232 /// - An invocation error will be reported if the error is thrown before the first call to
@@ -39,7 +39,7 @@ package protocol StreamingLambdaHandler {
3939 mutating func handle(
4040 _ event: ByteBuffer ,
4141 responseWriter: some LambdaResponseStreamWriter ,
42- context: NewLambdaContext
42+ context: LambdaContext
4343 ) async throws
4444}
4545
@@ -64,7 +64,7 @@ package protocol LambdaResponseStreamWriter {
6464///
6565/// - note: This handler protocol does not support response streaming because the output has to be encoded prior to it being sent, e.g. it is not possible to encode a partial/incomplete JSON string.
6666/// This protocol also does not support the execution of background work after the response has been returned -- the ``LambdaWithBackgroundProcessingHandler`` protocol caters for such use-cases.
67- package protocol NewLambdaHandler {
67+ package protocol LambdaHandler {
6868 /// Generic input type.
6969 /// The body of the request sent to Lambda will be decoded into this type for the handler to consume.
7070 associatedtype Event : Decodable
@@ -75,12 +75,12 @@ package protocol NewLambdaHandler {
7575 /// Implement the business logic of the Lambda function here.
7676 /// - Parameters:
7777 /// - event: The generic ``Event`` object representing the invocation's input data.
78- /// - context: The ``NewLambdaContext `` containing the invocation's metadata.
78+ /// - context: The ``LambdaContext `` containing the invocation's metadata.
7979 /// - Returns: A generic ``Output`` object representing the computed result.
80- func handle( _ event: Event , context: NewLambdaContext ) async throws -> Output
80+ func handle( _ event: Event , context: LambdaContext ) async throws -> Output
8181}
8282
83- /// This protocol is exactly like ``NewLambdaHandler ``, with the only difference being the added support for executing background
83+ /// This protocol is exactly like ``LambdaHandler ``, with the only difference being the added support for executing background
8484/// work after the result has been sent to the AWS Lambda control plane.
8585/// This is achieved by not having a return type in the `handle` function. The output is instead written into a
8686/// ``LambdaResponseWriter``that is passed in as an argument, meaning that the ``handle(_:)`` function is then free to implement
@@ -98,11 +98,11 @@ package protocol LambdaWithBackgroundProcessingHandler {
9898 /// - event: The generic ``Event`` object representing the invocation's input data.
9999 /// - outputWriter: The writer to send the computed response to. A call to `outputWriter.write(_:)` will return the response to the AWS Lambda response endpoint.
100100 /// Any background work can then be executed before returning.
101- /// - context: The ``NewLambdaContext `` containing the invocation's metadata.
101+ /// - context: The ``LambdaContext `` containing the invocation's metadata.
102102 func handle(
103103 _ event: Event ,
104104 outputWriter: some LambdaResponseWriter < Output > ,
105- context: NewLambdaContext
105+ context: LambdaContext
106106 ) async throws
107107}
108108
@@ -121,67 +121,67 @@ package protocol LambdaResponseWriter<Output> {
121121/// A ``StreamingLambdaHandler`` conforming handler object that can be constructed with a closure.
122122/// Allows for a handler to be defined in a clean manner, leveraging Swift's trailing closure syntax.
123123package struct StreamingClosureHandler : StreamingLambdaHandler {
124- let body : @Sendable ( ByteBuffer, LambdaResponseStreamWriter, NewLambdaContext ) async throws -> Void
124+ let body : @Sendable ( ByteBuffer, LambdaResponseStreamWriter, LambdaContext ) async throws -> Void
125125
126126 /// Initialize an instance from a handler function in the form of a closure.
127127 /// - Parameter body: The handler function written as a closure.
128128 package init (
129- body: @Sendable @escaping ( ByteBuffer, LambdaResponseStreamWriter, NewLambdaContext ) async throws -> Void
129+ body: @Sendable @escaping ( ByteBuffer, LambdaResponseStreamWriter, LambdaContext ) async throws -> Void
130130 ) {
131131 self . body = body
132132 }
133133
134- /// Calls the provided `self.body` closure with the ``ByteBuffer`` invocation event, the ``LambdaResponseStreamWriter``, and the ``NewLambdaContext ``
134+ /// Calls the provided `self.body` closure with the ``ByteBuffer`` invocation event, the ``LambdaResponseStreamWriter``, and the ``LambdaContext ``
135135 /// - Parameters:
136136 /// - event: The invocation's input data.
137137 /// - responseWriter: A ``LambdaResponseStreamWriter`` to write the invocation's response to.
138138 /// If no response or error is written to `responseWriter` an error will be reported to the invoker.
139- /// - context: The ``NewLambdaContext `` containing the invocation's metadata.
139+ /// - context: The ``LambdaContext `` containing the invocation's metadata.
140140 package func handle(
141141 _ request: ByteBuffer ,
142142 responseWriter: some LambdaResponseStreamWriter ,
143- context: NewLambdaContext
143+ context: LambdaContext
144144 ) async throws {
145145 try await self . body ( request, responseWriter, context)
146146 }
147147}
148148
149- /// A ``NewLambdaHandler `` conforming handler object that can be constructed with a closure.
149+ /// A ``LambdaHandler `` conforming handler object that can be constructed with a closure.
150150/// Allows for a handler to be defined in a clean manner, leveraging Swift's trailing closure syntax.
151- package struct ClosureHandler < Event: Decodable , Output> : NewLambdaHandler {
152- let body : ( Event , NewLambdaContext ) async throws -> Output
151+ package struct ClosureHandler < Event: Decodable , Output> : LambdaHandler {
152+ let body : ( Event , LambdaContext ) async throws -> Output
153153
154154 /// Initialize with a closure handler over generic `Input` and `Output` types.
155155 /// - Parameter body: The handler function written as a closure.
156- package init ( body: @escaping ( Event , NewLambdaContext ) async throws -> Output ) where Output: Encodable {
156+ package init ( body: @escaping ( Event , LambdaContext ) async throws -> Output ) where Output: Encodable {
157157 self . body = body
158158 }
159159
160160 /// Initialize with a closure handler over a generic `Input` type, and a `Void` `Output`.
161161 /// - Parameter body: The handler function written as a closure.
162- package init ( body: @escaping ( Event , NewLambdaContext ) async throws -> Void ) where Output == Void {
162+ package init ( body: @escaping ( Event , LambdaContext ) async throws -> Void ) where Output == Void {
163163 self . body = body
164164 }
165165
166- /// Calls the provided `self.body` closure with the generic ``Event`` object representing the incoming event, and the ``NewLambdaContext ``
166+ /// Calls the provided `self.body` closure with the generic ``Event`` object representing the incoming event, and the ``LambdaContext ``
167167 /// - Parameters:
168168 /// - event: The generic ``Event`` object representing the invocation's input data.
169- /// - context: The ``NewLambdaContext `` containing the invocation's metadata.
170- package func handle( _ event: Event , context: NewLambdaContext ) async throws -> Output {
169+ /// - context: The ``LambdaContext `` containing the invocation's metadata.
170+ package func handle( _ event: Event , context: LambdaContext ) async throws -> Output {
171171 try await self . body ( event, context)
172172 }
173173}
174174
175- extension NewLambdaRuntime {
175+ extension LambdaRuntime {
176176 /// Initialize an instance with a ``StreamingLambdaHandler`` in the form of a closure.
177177 /// - Parameter body: The handler in the form of a closure.
178178 package convenience init (
179- body: @Sendable @escaping ( ByteBuffer, LambdaResponseStreamWriter, NewLambdaContext ) async throws -> Void
179+ body: @Sendable @escaping ( ByteBuffer, LambdaResponseStreamWriter, LambdaContext ) async throws -> Void
180180 ) where Handler == StreamingClosureHandler {
181181 self . init ( handler: StreamingClosureHandler ( body: body) )
182182 }
183183
184- /// Initialize an instance with a ``NewLambdaHandler `` defined in the form of a closure **with a non-`Void` return type**, an encoder, and a decoder.
184+ /// Initialize an instance with a ``LambdaHandler `` defined in the form of a closure **with a non-`Void` return type**, an encoder, and a decoder.
185185 /// - Parameter body: The handler in the form of a closure.
186186 /// - Parameter encoder: The encoder object that will be used to encode the generic ``Output`` into a ``ByteBuffer``.
187187 /// - Parameter decoder: The decoder object that will be used to decode the incoming ``ByteBuffer`` event into the generic ``Event`` type.
@@ -193,7 +193,7 @@ extension NewLambdaRuntime {
193193 > (
194194 encoder: Encoder ,
195195 decoder: Decoder ,
196- body: @escaping ( Event , NewLambdaContext ) async throws -> Output
196+ body: @escaping ( Event , LambdaContext ) async throws -> Output
197197 )
198198 where
199199 Handler == LambdaCodableAdapter <
@@ -213,13 +213,13 @@ extension NewLambdaRuntime {
213213 self . init ( handler: handler)
214214 }
215215
216- /// Initialize an instance with a ``NewLambdaHandler `` defined in the form of a closure **with a `Void` return type**, an encoder, and a decoder.
216+ /// Initialize an instance with a ``LambdaHandler `` defined in the form of a closure **with a `Void` return type**, an encoder, and a decoder.
217217 /// - Parameter body: The handler in the form of a closure.
218218 /// - Parameter encoder: The encoder object that will be used to encode the generic ``Output`` into a ``ByteBuffer``.
219219 /// - Parameter decoder: The decoder object that will be used to decode the incoming ``ByteBuffer`` event into the generic ``Event`` type.
220220 package convenience init < Event: Decodable , Decoder: LambdaEventDecoder > (
221221 decoder: Decoder ,
222- body: @escaping ( Event , NewLambdaContext ) async throws -> Void
222+ body: @escaping ( Event , LambdaContext ) async throws -> Void
223223 )
224224 where
225225 Handler == LambdaCodableAdapter <
0 commit comments