Skip to content

Commit d496cbb

Browse files
committed
Extend on existing Lambda enum instead + refactor
1 parent 71f18eb commit d496cbb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/AWSLambdaRuntimeCore/NewLambda.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ package protocol StreamingLambdaHandler {
2424
) async throws
2525
}
2626

27-
package enum NewLambda {
27+
extension Lambda {
2828
package static func runLoop<RuntimeClient: LambdaRuntimeClientProtocol, Handler>(
2929
runtimeClient: RuntimeClient,
3030
handler: Handler,
3131
logger: Logger
32-
) async throws
33-
where Handler: StreamingLambdaHandler {
32+
) async throws where Handler: StreamingLambdaHandler {
33+
var handler = handler
34+
3435
while !Task.isCancelled {
3536
let (invocation, writer) = try await runtimeClient.nextInvocation()
3637

37-
var handler = handler
3838
do {
3939
try await handler.handle(
4040
invocation.event,

0 commit comments

Comments
 (0)