Skip to content

Commit e148f4a

Browse files
committed
Fix rebase
1 parent fe63732 commit e148f4a

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

Sources/AWSLambdaRuntime/Lambda+LocalServer.swift renamed to Sources/AWSLambdaRuntimeCore/Lambda+LocalServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private enum LocalLambda {
149149
Self.invocations.append(invocation)
150150
}
151151
// /next endpoint is called by the lambda polling for work
152-
case (.GET, let url) where url.hasSuffix(Consts.requestWorkURLSuffix):
152+
case (.GET, let url) where url.hasSuffix(Consts.getNextInvocationURLSuffix):
153153
// check if our server is in the correct state
154154
guard case .waitingForLambdaRequest = Self.invocationState else {
155155
self.logger.error("invalid invocation state \(Self.invocationState)")

Sources/AWSLambdaRuntimeCore/LambdaRunner.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extension Lambda {
4646
func run(logger: Logger, handler: Handler) -> EventLoopFuture<Void> {
4747
logger.debug("lambda invocation sequence starting")
4848
// 1. request work from lambda runtime engine
49-
return self.runtimeClient.requestWork(logger: logger).peekError { error in
49+
return self.runtimeClient.getNextInvocation(logger: logger).peekError { error in
5050
logger.error("could not fetch work from lambda runtime engine: \(error)")
5151
}.flatMap { invocation, payload in
5252
// 2. send invocation to handler

Sources/AWSLambdaRuntimeCore/Utils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Dispatch
1616
import NIO
1717

1818
internal enum Consts {
19-
private static let apiPrefix = "/2018-06-01"
19+
static let apiPrefix = "/2018-06-01"
2020
static let invocationURLPrefix = "\(apiPrefix)/runtime/invocation"
2121
static let getNextInvocationURLSuffix = "/next"
2222
static let postResponseURLSuffix = "/response"

Sources/StringSample/main.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import AWSLambdaRuntimeCore
15+
import AWSLambdaRuntime
1616
import NIO
1717

1818
// in this example we are receiving and responding with strings
@@ -26,7 +26,10 @@ struct Handler: EventLoopLambdaHandler {
2626
}
2727
}
2828

29-
Lambda.run(Handler())
29+
30+
try Lambda.withLocalServer {
31+
Lambda.run(Handler())
32+
}
3033

3134
// MARK: - this can also be expressed as a closure:
3235

0 commit comments

Comments
 (0)