12
12
//
13
13
//===----------------------------------------------------------------------===//
14
14
15
+ #if compiler(>=5.6)
16
+ @preconcurrency import Dispatch
17
+ @preconcurrency import Logging
18
+ @preconcurrency import NIOCore
19
+ #else
15
20
import Dispatch
16
21
import Logging
17
22
import NIOCore
23
+ #endif
18
24
19
25
// MARK: - InitializationContext
20
26
@@ -23,7 +29,7 @@ extension Lambda {
23
29
/// The Lambda runtime generates and passes the `InitializationContext` to the Handlers
24
30
/// ``ByteBufferLambdaHandler/makeHandler(context:)`` or ``LambdaHandler/init(context:)``
25
31
/// as an argument.
26
- public struct InitializationContext {
32
+ public struct InitializationContext : _AWSLambdaSendable {
27
33
/// `Logger` to log with
28
34
///
29
35
/// - note: The `LogLevel` can be configured using the `LOG_LEVEL` environment variable.
@@ -62,17 +68,17 @@ extension Lambda {
62
68
63
69
/// Lambda runtime context.
64
70
/// 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
76
82
77
83
init (
78
84
requestID: String ,
@@ -211,7 +217,7 @@ public struct LambdaContext: CustomDebugStringConvertible {
211
217
extension Lambda {
212
218
/// Lambda runtime shutdown context.
213
219
/// 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 {
215
221
/// `Logger` to log with
216
222
///
217
223
/// - note: The `LogLevel` can be configured using the `LOG_LEVEL` environment variable.
0 commit comments