File tree 3 files changed +7
-6
lines changed
Sources/AWSLambdaRuntimeCore
3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public enum Lambda {
60
60
}
61
61
62
62
/// The default EventLoop the Lambda is scheduled on.
63
- public static var defaultEventLoop : any EventLoop = NIOSingletons . posixEventLoopGroup. next ( )
63
+ public static let defaultEventLoop : any EventLoop = NIOSingletons . posixEventLoopGroup. next ( )
64
64
}
65
65
66
66
// MARK: - Public API
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ extension LambdaRuntime {
194
194
> (
195
195
encoder: Encoder ,
196
196
decoder: Decoder ,
197
- body: @escaping ( Event , LambdaContext ) async throws -> Output
197
+ body: sending @escaping ( Event , LambdaContext ) async throws -> Output
198
198
)
199
199
where
200
200
Handler == LambdaCodableAdapter <
@@ -220,7 +220,7 @@ extension LambdaRuntime {
220
220
/// - body: The handler in the form of a closure.
221
221
public convenience init < Event: Decodable , Decoder: LambdaEventDecoder > (
222
222
decoder: Decoder ,
223
- body: @escaping ( Event , LambdaContext ) async throws -> Void
223
+ body: sending @escaping ( Event , LambdaContext ) async throws -> Void
224
224
)
225
225
where
226
226
Handler == LambdaCodableAdapter <
Original file line number Diff line number Diff line change @@ -88,15 +88,16 @@ struct LambdaRequestID {
88
88
}
89
89
90
90
/// thread safe secure random number generator.
91
- private static var generator = SystemRandomNumberGenerator ( )
92
91
private static func generateRandom( ) -> Self {
92
+ var generator = SystemRandomNumberGenerator ( )
93
+
93
94
var _uuid : uuid_t = LambdaRequestID . null
94
95
// https://tools.ietf.org/html/rfc4122#page-14
95
96
// o Set all the other bits to randomly (or pseudo-randomly) chosen
96
97
// values.
97
98
withUnsafeMutableBytes ( of: & _uuid) { ptr in
98
- ptr. storeBytes ( of: Self . generator. next ( ) , toByteOffset: 0 , as: UInt64 . self)
99
- ptr. storeBytes ( of: Self . generator. next ( ) , toByteOffset: 8 , as: UInt64 . self)
99
+ ptr. storeBytes ( of: generator. next ( ) , toByteOffset: 0 , as: UInt64 . self)
100
+ ptr. storeBytes ( of: generator. next ( ) , toByteOffset: 8 , as: UInt64 . self)
100
101
}
101
102
102
103
// o Set the four most significant bits (bits 12 through 15) of the
You can’t perform that action at this time.
0 commit comments