Skip to content

Commit 4b4054d

Browse files
authored
Remove unnecessary Sendable constraint (#622)
This PR removes `Sendable` requirement on `StreamingClosureHandler `. While analyzing code for the upcoming support of Lambda Managed Runtime, I found out that `StreamingClosureHandler` has `Sendable` requirement, which is not necessary. Removing requirement doesn't require a major speed bump as the change is compatible with existing code.
1 parent e0f064a commit 4b4054d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/AWSLambdaRuntime/Runtime/LambdaHandlers.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ public protocol LambdaResponseWriter<Output> {
128128
/// A ``StreamingLambdaHandler`` conforming handler object that can be constructed with a closure.
129129
/// Allows for a handler to be defined in a clean manner, leveraging Swift's trailing closure syntax.
130130
@available(LambdaSwift 2.0, *)
131-
public struct StreamingClosureHandler: StreamingLambdaHandler & Sendable {
132-
let body: @Sendable (ByteBuffer, LambdaResponseStreamWriter, LambdaContext) async throws -> Void
131+
public struct StreamingClosureHandler: StreamingLambdaHandler {
132+
let body: (ByteBuffer, LambdaResponseStreamWriter, LambdaContext) async throws -> Void
133133

134134
/// Initialize an instance from a handler function in the form of a closure.
135135
/// - Parameter body: The handler function written as a closure.
136136
public init(
137-
body: @Sendable @escaping (ByteBuffer, LambdaResponseStreamWriter, LambdaContext) async throws -> Void
137+
body: @escaping (ByteBuffer, LambdaResponseStreamWriter, LambdaContext) async throws -> Void
138138
) {
139139
self.body = body
140140
}

0 commit comments

Comments
 (0)