@@ -28,12 +28,11 @@ Versions:
28
28
#### EventLoop interfaces
29
29
30
30
The current API extensively uses the ` EventLoop ` family of interfaces from SwiftNIO in many areas. To use these
31
- interfaces correctly though, it requires developers to exercise great care and be aware of certain details such as never
32
- running blocking code on the same ` EventLoop ` the library uses. Developers also need to understand the various transform
33
- methods that are used to work with ` EventLoop ` s and ` EventLoopFuture ` s. This results in a lot of cognitive complexity
34
- and makes the code in the current API hard to reason about and maintain. For these reasons, the overarching trend in the
35
- Swift on Server ecosystem is to shift to newer, more readable, Swift concurrency constructs and de-couple from
36
- SwiftNIO's ` EventLoop ` interfaces.
31
+ interfaces correctly though, it requires developers to exercise great care and understand the various transform methods
32
+ that are used to work with ` EventLoop ` s and ` EventLoopFuture ` s. This results in a lot of cognitive complexity and makes
33
+ the code in the current API hard to reason about and maintain. For these reasons, the overarching trend in the Swift on
34
+ Server ecosystem is to shift to newer, more readable, Swift concurrency constructs and de-couple from SwiftNIO's
35
+ ` EventLoop ` interfaces.
37
36
38
37
#### No ownership of the main() function
39
38
@@ -262,15 +261,15 @@ this protocol and instead use the `LambdaHandler` protocol defined below.
262
261
263
262
``` swift
264
263
/// The base StreamingLambdaHandler protocol
265
- public protocol StreamingLambdaHandler : ~ Copyable {
264
+ public protocol StreamingLambdaHandler {
266
265
/// The business logic of the Lambda function
267
266
/// - Parameters:
268
267
/// - event: The invocation's input data
269
268
/// - responseWriter: A ``LambdaResponseStreamWriter`` to write the invocation's response to.
270
269
/// If no response or error is written to the `responseWriter` it will
271
270
/// report an error to the invoker.
272
271
/// - context: The LambdaContext containing the invocation's metadata
273
- /// - Throws
272
+ /// - Throws:
274
273
/// How the thrown error will be handled by the runtime:
275
274
/// - An invocation error will be reported if the error is thrown before the first call to
276
275
/// ``LambdaResponseStreamWriter.write(_:)``.
@@ -296,7 +295,7 @@ plane, since the `handle(...)` function is free to implement any background work
296
295
` responseWriter.finish() ` .
297
296
298
297
The protocol is defined in a way that supports a broad range of use-cases. The handle method is marked as ` mutating ` to
299
- allow handlers to be implemented with a ` struct ` . Users can opt to even mark the handler as non-copyable.
298
+ allow handlers to be implemented with a ` struct ` .
300
299
301
300
An implementation that sends the number 1 to 10 every 500ms could look like this:
302
301
@@ -451,7 +450,7 @@ provide support for `swift-service-lifecycle`.
451
450
/// The LambdaRuntime object. This object communicates with the Lambda control plane
452
451
/// to fetch work and report errors.
453
452
public final class LambdaRuntime <Handler >: ServiceLifecycle .Service , Sendable
454
- where Handler: StreamingLambdaHandler , Handler : ~Copyable
453
+ where Handler: StreamingLambdaHandler
455
454
{
456
455
457
456
/// Create a LambdaRuntime by passing a handler, an eventLoop and a logger.
@@ -792,7 +791,7 @@ The `StreamingLambdaHandler` would look like this:
792
791
793
792
``` swift
794
793
/// The base LambdaHandler protocol
795
- public protocol StreamingLambdaHandler : ~ Copyable {
794
+ public protocol StreamingLambdaHandler {
796
795
/// The business logic of the Lambda function
797
796
/// - Parameters:
798
797
/// - event: The invocation's input data
0 commit comments