Skip to content

Remove unnecessary handler constraints #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/AWSLambdaRuntime/Lambda+Codable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ public struct LambdaCodableAdapter<
}

/// A ``StreamingLambdaHandler/handle(_:responseWriter:context:)`` wrapper.
/// - Parameters:
/// - event: The received event.
/// - outputWriter: The writer to write the computed response to.
/// - Parameters:
/// - request: The received event.
/// - responseWriter: The writer to write the computed response to.
/// - context: The ``LambdaContext`` containing the invocation's metadata.
@inlinable
public mutating func handle<Writer: LambdaResponseStreamWriter>(
Expand Down
11 changes: 6 additions & 5 deletions Sources/AWSLambdaRuntime/LambdaHandlers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public protocol LambdaResponseStreamWriter {
public protocol LambdaHandler {
/// Generic input type.
/// The body of the request sent to Lambda will be decoded into this type for the handler to consume.
associatedtype Event: Decodable
associatedtype Event
/// Generic output type.
/// This is the return type of the ``LambdaHandler/handle(_:context:)`` function.
associatedtype Output
Expand All @@ -89,7 +89,7 @@ public protocol LambdaHandler {
public protocol LambdaWithBackgroundProcessingHandler {
/// Generic input type.
/// The body of the request sent to Lambda will be decoded into this type for the handler to consume.
associatedtype Event: Decodable
associatedtype Event
/// Generic output type.
/// This is the type that the `handle` function will send through the ``LambdaResponseWriter``.
associatedtype Output
Expand Down Expand Up @@ -183,9 +183,10 @@ extension LambdaRuntime {
}

/// Initialize an instance with a ``LambdaHandler`` defined in the form of a closure **with a non-`Void` return type**, an encoder, and a decoder.
/// - Parameter body: The handler in the form of a closure.
/// - Parameter encoder: The encoder object that will be used to encode the generic `Output` into a `ByteBuffer`.
/// - Parameter decoder: The decoder object that will be used to decode the incoming `ByteBuffer` event into the generic `Event` type.
/// - Parameters:
/// - encoder: The encoder object that will be used to encode the generic `Output` into a `ByteBuffer`.
/// - decoder: The decoder object that will be used to decode the incoming `ByteBuffer` event into the generic `Event` type.
/// - body: The handler in the form of a closure.
public convenience init<
Event: Decodable,
Output: Encodable,
Expand Down
Loading