Skip to content

Commit 4a44503

Browse files
committed
cleanup
1 parent 17ed17b commit 4a44503

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.6
1+
// swift-tools-version:5.7
22

33
import PackageDescription
44

@@ -15,7 +15,7 @@ let package = Package(
1515
.library(name: "AWSLambdaTesting", targets: ["AWSLambdaTesting"]),
1616
],
1717
dependencies: [
18-
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.33.0")),
18+
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.43.1")),
1919
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.2")),
2020
.package(url: "https://github.com/swift-server/swift-backtrace.git", .upToNextMajor(from: "1.2.3")),
2121
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),

Sources/AWSLambdaRuntimeCore/Lambda.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public enum Lambda {
6060

6161
var result: Result<Int, Error>!
6262
MultiThreadedEventLoopGroup.withCurrentThreadAsEventLoop { eventLoop in
63-
let runtime = LambdaRuntime(handlerType, eventLoop: eventLoop, logger: logger, configuration: configuration)
63+
let runtime = LambdaRuntime(handlerType: handlerType, eventLoop: eventLoop, logger: logger, configuration: configuration)
6464
#if DEBUG
6565
let signalSource = trap(signal: configuration.lifecycle.stopSignal) { signal in
6666
logger.info("intercepted signal: \(signal)")

Sources/AWSLambdaRuntimeCore/LambdaRunner.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ internal final class LambdaRunner {
6060
}
6161
}
6262

63-
func run(logger: Logger, handler: any ByteBufferLambdaHandler) -> EventLoopFuture<Void> {
63+
func run(handler: any ByteBufferLambdaHandler, logger: Logger) -> EventLoopFuture<Void> {
6464
logger.debug("lambda invocation sequence starting")
6565
// 1. request invocation from lambda runtime engine
6666
self.isGettingNextInvocation = true

Sources/AWSLambdaRuntimeCore/LambdaRuntime.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ public final class LambdaRuntime {
6262
/// - eventLoop: An `EventLoop` to run the Lambda on.
6363
/// - logger: A `Logger` to log the Lambda events.
6464
public convenience init(_ handlerType: (some ByteBufferLambdaHandler).Type, eventLoop: EventLoop, logger: Logger) {
65-
self.init(handlerType, eventLoop: eventLoop, logger: logger, configuration: .init())
65+
self.init(handlerType: handlerType, eventLoop: eventLoop, logger: logger, configuration: .init())
6666
}
6767

68-
init(_ handlerType: (some ByteBufferLambdaHandler).Type, eventLoop: EventLoop, logger: Logger, configuration: LambdaConfiguration) {
68+
init(handlerType: (some ByteBufferLambdaHandler).Type, eventLoop: EventLoop, logger: Logger, configuration: LambdaConfiguration) {
6969
self.eventLoop = eventLoop
7070
self.shutdownPromise = eventLoop.makePromise(of: Int.self)
7171
self.logger = logger
@@ -165,7 +165,7 @@ public final class LambdaRuntime {
165165
}
166166
var logger = self.logger
167167
logger[metadataKey: "lifecycleIteration"] = "\(count)"
168-
runner.run(logger: logger, handler: handler).whenComplete { result in
168+
runner.run(handler: handler, logger: logger).whenComplete { result in
169169
switch result {
170170
case .success:
171171
logger.log(level: .debug, "lambda invocation sequence completed successfully")

Tests/AWSLambdaRuntimeCoreTests/LambdaTest.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,15 @@ class LambdaTest: XCTestCase {
279279
let runner = LambdaRunner(eventLoop: eventLoopGroup.next(), configuration: configuration)
280280

281281
try runner.run(
282-
logger: logger,
283282
handler: CodableEventLoopLambdaHandler(
284283
handler: handler1,
285284
allocator: ByteBufferAllocator()
286-
)
285+
),
286+
logger: logger
287287
).wait()
288288

289289
try runner.initialize(handlerType: CodableEventLoopLambdaHandler<Handler>.self, logger: logger, terminator: LambdaTerminator()).flatMap { handler2 in
290-
runner.run(logger: logger, handler: handler2)
290+
runner.run(handler: handler2, logger: logger)
291291
}.wait()
292292
}
293293

Tests/AWSLambdaRuntimeCoreTests/Utils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func runLambda(behavior: LambdaServerBehavior, handlerType: (some ByteBufferLamb
3737
let server = try MockLambdaServer(behavior: behavior).start().wait()
3838
defer { XCTAssertNoThrow(try server.stop().wait()) }
3939
try runner.initialize(handlerType: handlerType, logger: logger, terminator: terminator).flatMap { handler in
40-
runner.run(logger: logger, handler: handler)
40+
runner.run(handler: handler, logger: logger)
4141
}.wait()
4242
}
4343

0 commit comments

Comments
 (0)