mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-05-03 07:22:27 +00:00
Add support for Lambda Managed Instances without changing the public API [Convenience + Example] (#623)
This PR builds on https://github.com/awslabs/swift-aws-lambda-runtime/pull/629 to add convenience structs (Handlers and Adapters) that are `Sendable` **Changes** - **Added Sendable adapter types**: Implemented `ClosureHandlerSendable` - a thread-safe version of existing closure handler that enforces `Sendable` conformance for concurrent execution environments - and added conditional conformance to `Sendable` for other Adapters when the Handler is `Sendable` - **Enhanced handler protocols for concurrency**: Extended handler protocols to support `Sendable` constraints and concurrent response writing through `LambdaResponseStreamWriter & Sendable`, enabling safe multi-threaded invocation processing - **Created comprehensive Lambda Managed Instances examples**: Built three demonstration functions showcasing concurrent execution capabilities, streaming responses, and background processing patterns specific to the new managed instances deployment model **Context** Lambda Managed Instances support multi-concurrent invocations where multiple invocations execute simultaneously within the same execution environment. The runtime now detects the configured concurrency level and launches the appropriate number of RICs to handle concurrent requests efficiently. When `AWS_LAMBDA_MAX_CONCURRENCY` is 1 or unset, the runtime maintains the existing single-threaded behaviour for optimal performance on traditional Lambda deployments. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Sebastien Stormacq <stormacq@amazon.lu>
This commit is contained in:
committed by
GitHub
parent
d456396581
commit
190eb81876
@@ -40,7 +40,7 @@ jobs:
|
||||
# We pass the list of examples here, but we can't pass an array as argument
|
||||
# Instead, we pass a String with a valid JSON array.
|
||||
# The workaround is mentioned here https://github.com/orgs/community/discussions/11692
|
||||
examples: "[ 'APIGatewayV1', 'APIGatewayV2', 'APIGatewayV2+LambdaAuthorizer', 'BackgroundTasks', 'HelloJSON', 'HelloWorld', 'HelloWorldNoTraits', 'HummingbirdLambda', 'MultiSourceAPI', 'MultiTenant', 'ResourcesPackaging', 'S3EventNotifier', 'S3_AWSSDK', 'S3_Soto', 'Streaming+APIGateway', 'Streaming+FunctionUrl', 'Streaming+Codable', 'ServiceLifecycle+Postgres', 'Testing', 'Tutorial' ]"
|
||||
examples: "[ 'APIGatewayV1', 'APIGatewayV2', 'APIGatewayV2+LambdaAuthorizer', 'BackgroundTasks', 'HelloJSON', 'HelloWorld', 'HelloWorldNoTraits', 'HummingbirdLambda', 'ManagedInstances', 'MultiSourceAPI', 'MultiTenant', 'ResourcesPackaging', 'S3EventNotifier', 'S3_AWSSDK', 'S3_Soto', 'Streaming+APIGateway', 'Streaming+FunctionUrl', 'Streaming+Codable', 'ServiceLifecycle+Postgres', 'Testing', 'Tutorial' ]"
|
||||
archive_plugin_examples: "[ 'HelloWorld', 'ResourcesPackaging' ]"
|
||||
archive_plugin_enabled: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user