From 4970be9c36d08244ca3f640a77e392e2b305b84f Mon Sep 17 00:00:00 2001 From: Adam Fowler Date: Sat, 28 Jun 2025 14:24:54 +0000 Subject: [PATCH] Add SendableMetatype conformance --- Sources/AWSLambdaRuntime/LambdaHandlers.swift | 2 +- .../AWSLambdaRuntime/SendableMetatype.swift | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 Sources/AWSLambdaRuntime/SendableMetatype.swift diff --git a/Sources/AWSLambdaRuntime/LambdaHandlers.swift b/Sources/AWSLambdaRuntime/LambdaHandlers.swift index d6e0b373..4b5975cb 100644 --- a/Sources/AWSLambdaRuntime/LambdaHandlers.swift +++ b/Sources/AWSLambdaRuntime/LambdaHandlers.swift @@ -20,7 +20,7 @@ import NIOCore /// Background work can also be executed after returning the response. After closing the response stream by calling /// ``LambdaResponseStreamWriter/finish()`` or ``LambdaResponseStreamWriter/writeAndFinish(_:)``, /// the ``handle(_:responseWriter:context:)`` function is free to execute any background work. -public protocol StreamingLambdaHandler { +public protocol StreamingLambdaHandler: _Lambda_SendableMetatype { /// The handler function -- implement the business logic of the Lambda function here. /// - Parameters: /// - event: The invocation's input data. diff --git a/Sources/AWSLambdaRuntime/SendableMetatype.swift b/Sources/AWSLambdaRuntime/SendableMetatype.swift new file mode 100644 index 00000000..a33f1aab --- /dev/null +++ b/Sources/AWSLambdaRuntime/SendableMetatype.swift @@ -0,0 +1,21 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the SwiftAWSLambdaRuntime open source project +// +// Copyright (c) 2025 Apple Inc. and the SwiftAWSLambdaRuntime project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +#if compiler(>=6.2) +@_documentation(visibility: internal) +public typealias _Lambda_SendableMetatype = SendableMetatype +#else +@_documentation(visibility: internal) +public typealias _Lambda_SendableMetatype = Any +#endif