Skip to content

Commit 16ce236

Browse files
committed
another name!
1 parent 729e0dc commit 16ce236

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

Sources/AWSLambdaRuntimeCore/Lambda.swift

+2-5
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,15 @@ public enum Lambda {
8989
Self.run(configuration: configuration, handlerProvider: handlerType.makeHandler(context:))
9090
}
9191

92-
/// Run a Lambda defined by implementing the ``ByteBufferLambdaHandler`` protocol.
93-
/// The Runtime will manage the Lambdas application lifecycle automatically. It will invoke the
94-
/// ``ByteBufferLambdaHandler/makeHandler(context:)`` to create a new Handler.
95-
///
92+
/// Run a Lambda defined by implementing the ``LambdaRuntimeHandler`` protocol.
9693
/// - parameters:
9794
/// - configuration: A Lambda runtime configuration object
9895
/// - handlerProvider: A provider of the Handler to invoke.
9996
///
10097
/// - note: This is a blocking operation that will run forever, as its lifecycle is managed by the AWS Lambda Runtime Engine.
10198
internal static func run(
10299
configuration: LambdaConfiguration = .init(),
103-
handlerProvider: @escaping (LambdaInitializationContext) -> EventLoopFuture<some NonInitializingByteBufferLambdaHandler>
100+
handlerProvider: @escaping (LambdaInitializationContext) -> EventLoopFuture<some LambdaRuntimeHandler>
104101
) -> Result<Int, Error> {
105102
let _run = { (configuration: LambdaConfiguration) -> Result<Int, Error> in
106103
#if swift(<5.9)

Sources/AWSLambdaRuntimeCore/LambdaHandler.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ extension EventLoopLambdaHandler {
398398
/// - note: This is a low level protocol designed to power the higher level ``EventLoopLambdaHandler`` and
399399
/// ``LambdaHandler`` based APIs.
400400
/// Most users are not expected to use this protocol.
401-
public protocol ByteBufferLambdaHandler: NonInitializingByteBufferLambdaHandler {
401+
public protocol ByteBufferLambdaHandler: LambdaRuntimeHandler {
402402
/// Create a Lambda handler for the runtime.
403403
///
404404
/// Use this to initialize all your resources that you want to cache between invocations. This could be database
@@ -433,7 +433,7 @@ extension ByteBufferLambdaHandler {
433433
}
434434
}
435435

436-
// MARK: - NonInitializingByteBufferLambdaHandler
436+
// MARK: - LambdaRuntimeHandler
437437

438438
/// An `EventLoopFuture` based processing protocol for a Lambda that takes a `ByteBuffer` and returns
439439
/// an optional `ByteBuffer` asynchronously.
@@ -442,7 +442,7 @@ extension ByteBufferLambdaHandler {
442442
/// runtime with a handler outside the normal initialization of
443443
/// ``ByteBufferLambdaHandler``, ``EventLoopLambdaHandler`` and ``LambdaHandler`` based APIs.
444444
/// Most users are not expected to use this protocol.
445-
public protocol NonInitializingByteBufferLambdaHandler {
445+
public protocol LambdaRuntimeHandler {
446446
/// The Lambda handling method.
447447
/// Concrete Lambda handlers implement this method to provide the Lambda functionality.
448448
///

Sources/AWSLambdaRuntimeCore/LambdaRunner.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ internal final class LambdaRunner {
3333
/// Run the user provided initializer. This *must* only be called once.
3434
///
3535
/// - Returns: An `EventLoopFuture<LambdaHandler>` fulfilled with the outcome of the initialization.
36-
func initialize<Handler: NonInitializingByteBufferLambdaHandler>(
36+
func initialize<Handler: LambdaRuntimeHandler>(
3737
handlerProvider: @escaping (LambdaInitializationContext) -> EventLoopFuture<Handler>,
3838
logger: Logger,
3939
terminator: LambdaTerminator
@@ -63,7 +63,7 @@ internal final class LambdaRunner {
6363
}
6464
}
6565

66-
func run(handler: some NonInitializingByteBufferLambdaHandler, logger: Logger) -> EventLoopFuture<Void> {
66+
func run(handler: some LambdaRuntimeHandler, logger: Logger) -> EventLoopFuture<Void> {
6767
logger.debug("lambda invocation sequence starting")
6868
// 1. request invocation from lambda runtime engine
6969
self.isGettingNextInvocation = true

Sources/AWSLambdaRuntimeCore/LambdaRuntime.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import NIOCore
1919
/// `LambdaRuntime` manages the Lambda process lifecycle.
2020
///
2121
/// Use this API, if you build a higher level web framework which shall be able to run inside the Lambda environment.
22-
public final class LambdaRuntime<Handler: NonInitializingByteBufferLambdaHandler> {
22+
public final class LambdaRuntime<Handler: LambdaRuntimeHandler> {
2323
private let eventLoop: EventLoop
2424
private let shutdownPromise: EventLoopPromise<Int>
2525
private let logger: Logger
@@ -200,7 +200,7 @@ public final class LambdaRuntime<Handler: NonInitializingByteBufferLambdaHandler
200200
private enum State {
201201
case idle
202202
case initializing
203-
case active(LambdaRunner, any NonInitializingByteBufferLambdaHandler)
203+
case active(LambdaRunner, any LambdaRuntimeHandler)
204204
case shuttingdown
205205
case shutdown
206206

@@ -252,7 +252,7 @@ public enum LambdaRuntimeFactory {
252252
_ handlerType: Handler.Type,
253253
eventLoop: any EventLoop,
254254
logger: Logger
255-
) -> LambdaRuntime<some NonInitializingByteBufferLambdaHandler> {
255+
) -> LambdaRuntime<some LambdaRuntimeHandler> {
256256
LambdaRuntime<CodableLambdaHandler<Handler>>(
257257
handlerProvider: CodableLambdaHandler<Handler>.makeHandler(context:),
258258
eventLoop: eventLoop,
@@ -271,7 +271,7 @@ public enum LambdaRuntimeFactory {
271271
_ handlerType: Handler.Type,
272272
eventLoop: any EventLoop,
273273
logger: Logger
274-
) -> LambdaRuntime<some NonInitializingByteBufferLambdaHandler> {
274+
) -> LambdaRuntime<some LambdaRuntimeHandler> {
275275
LambdaRuntime<CodableEventLoopLambdaHandler<Handler>>(
276276
handlerProvider: CodableEventLoopLambdaHandler<Handler>.makeHandler(context:),
277277
eventLoop: eventLoop,
@@ -290,7 +290,7 @@ public enum LambdaRuntimeFactory {
290290
_ handlerType: Handler.Type,
291291
eventLoop: any EventLoop,
292292
logger: Logger
293-
) -> LambdaRuntime<some NonInitializingByteBufferLambdaHandler> {
293+
) -> LambdaRuntime<some LambdaRuntimeHandler> {
294294
LambdaRuntime<Handler>(
295295
handlerProvider: Handler.makeHandler(context:),
296296
eventLoop: eventLoop,
@@ -301,11 +301,11 @@ public enum LambdaRuntimeFactory {
301301
/// Create a new `LambdaRuntime`.
302302
///
303303
/// - parameters:
304-
/// - handlerProvider: A provider of the ``CoreByteBufferLambdaHandler`` the `LambdaRuntime` will manage.
304+
/// - handlerProvider: A provider of the ``LambdaRuntimeHandler`` the `LambdaRuntime` will call to create the handler.
305305
/// - eventLoop: An `EventLoop` to run the Lambda on.
306306
/// - logger: A `Logger` to log the Lambda events.
307307
@inlinable
308-
public static func makeRuntime<Handler: NonInitializingByteBufferLambdaHandler>(
308+
public static func makeRuntime<Handler: LambdaRuntimeHandler>(
309309
handlerProvider: @escaping (LambdaInitializationContext) -> EventLoopFuture<Handler>,
310310
eventLoop: any EventLoop,
311311
logger: Logger
@@ -320,11 +320,11 @@ public enum LambdaRuntimeFactory {
320320
/// Create a new `LambdaRuntime`.
321321
///
322322
/// - parameters:
323-
/// - handlerProvider: A provider of the ``CoreByteBufferLambdaHandler`` the `LambdaRuntime` will manage.
323+
/// - handlerProvider: A provider of the ``LambdaRuntimeHandler`` the `LambdaRuntime` will call to create the handler.
324324
/// - eventLoop: An `EventLoop` to run the Lambda on.
325325
/// - logger: A `Logger` to log the Lambda events.
326326
@inlinable
327-
public static func makeRuntime<Handler: NonInitializingByteBufferLambdaHandler>(
327+
public static func makeRuntime<Handler: LambdaRuntimeHandler>(
328328
handlerProvider: @escaping (LambdaInitializationContext) async throws -> Handler,
329329
eventLoop: any EventLoop,
330330
logger: Logger

0 commit comments

Comments
 (0)