1212//
1313//===----------------------------------------------------------------------===//
1414
15+ #if compiler(>=5.6)
16+ @preconcurrency import Dispatch
17+ @preconcurrency import Logging
18+ @preconcurrency import NIOCore
19+ #else
1520import Dispatch
1621import Logging
1722import NIOCore
23+ #endif
1824
1925// MARK: - InitializationContext
2026
@@ -23,7 +29,7 @@ extension Lambda {
2329 /// The Lambda runtime generates and passes the `InitializationContext` to the Handlers
2430 /// ``ByteBufferLambdaHandler/makeHandler(context:)`` or ``LambdaHandler/init(context:)``
2531 /// as an argument.
26- public struct InitializationContext {
32+ public struct InitializationContext : _AWSLambdaSendable {
2733 /// `Logger` to log with
2834 ///
2935 /// - note: The `LogLevel` can be configured using the `LOG_LEVEL` environment variable.
@@ -62,17 +68,17 @@ extension Lambda {
6268
6369/// Lambda runtime context.
6470/// The Lambda runtime generates and passes the `Context` to the Lambda handler as an argument.
65- public struct LambdaContext : CustomDebugStringConvertible {
66- final class _Storage {
67- var requestID : String
68- var traceID : String
69- var invokedFunctionARN : String
70- var deadline : DispatchWallTime
71- var cognitoIdentity : String ?
72- var clientContext : String ?
73- var logger : Logger
74- var eventLoop : EventLoop
75- var allocator : ByteBufferAllocator
71+ public struct LambdaContext : CustomDebugStringConvertible , _AWSLambdaSendable {
72+ final class _Storage : _AWSLambdaSendable {
73+ let requestID : String
74+ let traceID : String
75+ let invokedFunctionARN : String
76+ let deadline : DispatchWallTime
77+ let cognitoIdentity : String ?
78+ let clientContext : String ?
79+ let logger : Logger
80+ let eventLoop : EventLoop
81+ let allocator : ByteBufferAllocator
7682
7783 init (
7884 requestID: String ,
@@ -211,7 +217,7 @@ public struct LambdaContext: CustomDebugStringConvertible {
211217extension Lambda {
212218 /// Lambda runtime shutdown context.
213219 /// The Lambda runtime generates and passes the `ShutdownContext` to the Lambda handler as an argument.
214- public final class ShutdownContext {
220+ public final class ShutdownContext : _AWSLambdaSendable {
215221 /// `Logger` to log with
216222 ///
217223 /// - note: The `LogLevel` can be configured using the `LOG_LEVEL` environment variable.
0 commit comments