@@ -113,9 +113,9 @@ final actor NewLambdaRuntimeClient: LambdaRuntimeClientProtocol {
113
113
return ( invocation, Writer ( runtimeClient: self ) )
114
114
115
115
case . waitingForNextInvocation,
116
- . waitingForResponse,
117
- . sendingResponse,
118
- . sentResponse:
116
+ . waitingForResponse,
117
+ . sendingResponse,
118
+ . sentResponse:
119
119
fatalError ( " Invalid state: \( self . lambdaState) " )
120
120
}
121
121
@@ -219,7 +219,9 @@ final actor NewLambdaRuntimeClient: LambdaRuntimeClientProtocol {
219
219
try channel. pipeline. syncOperations. addHandler (
220
220
NIOHTTPClientResponseAggregator ( maxContentLength: 6 * 1024 * 1024 )
221
221
)
222
- try channel. pipeline. syncOperations. addHandler ( LambdaChannelHandler ( delegate: self , logger: self . logger) )
222
+ try channel. pipeline. syncOperations. addHandler (
223
+ LambdaChannelHandler ( delegate: self , logger: self . logger)
224
+ )
223
225
return channel. eventLoop. makeSucceededFuture ( ( ) )
224
226
} catch {
225
227
return channel. eventLoop. makeFailedFuture ( error)
@@ -230,7 +232,9 @@ final actor NewLambdaRuntimeClient: LambdaRuntimeClientProtocol {
230
232
// connect directly via socket address to avoid happy eyeballs (perf)
231
233
let address = try SocketAddress ( ipAddress: self . configuration. ip, port: self . configuration. port)
232
234
let channel = try await bootstrap. connect ( to: address) . get ( )
233
- let handler = try channel. pipeline. syncOperations. handler ( type: LambdaChannelHandler< NewLambdaRuntimeClient> . self )
235
+ let handler = try channel. pipeline. syncOperations. handler (
236
+ type: LambdaChannelHandler< NewLambdaRuntimeClient> . self
237
+ )
234
238
channel. closeFuture. whenComplete { result in
235
239
self . eventLoop. preconditionInEventLoop ( )
236
240
self . assumeIsolated { runtimeClient in
@@ -338,7 +342,11 @@ private final class LambdaChannelHandler<Delegate> {
338
342
}
339
343
}
340
344
341
- func reportError( isolation: isolated ( any Actor ) ? = #isolation, _ error: any Error , requestID: String ) async throws {
345
+ func reportError(
346
+ isolation: isolated ( any Actor ) ? = #isolation,
347
+ _ error: any Error ,
348
+ requestID: String
349
+ ) async throws {
342
350
switch self . state {
343
351
case . connected( _, . waitingForNextInvocation) :
344
352
fatalError ( " Invalid state: \( self . state) " )
@@ -376,7 +384,11 @@ private final class LambdaChannelHandler<Delegate> {
376
384
}
377
385
}
378
386
379
- func writeResponseBodyPart( isolation: isolated ( any Actor ) ? = #isolation, _ byteBuffer: ByteBuffer , requestID: String ) async throws {
387
+ func writeResponseBodyPart(
388
+ isolation: isolated ( any Actor ) ? = #isolation,
389
+ _ byteBuffer: ByteBuffer ,
390
+ requestID: String
391
+ ) async throws {
380
392
switch self . state {
381
393
case . connected( _, . waitingForNextInvocation) :
382
394
fatalError ( " Invalid state: \( self . state) " )
@@ -400,7 +412,11 @@ private final class LambdaChannelHandler<Delegate> {
400
412
}
401
413
}
402
414
403
- func finishResponseRequest( isolation: isolated ( any Actor ) ? = #isolation, finalData: ByteBuffer ? , requestID: String ) async throws {
415
+ func finishResponseRequest(
416
+ isolation: isolated ( any Actor ) ? = #isolation,
417
+ finalData: ByteBuffer ? ,
418
+ requestID: String
419
+ ) async throws {
404
420
switch self . state {
405
421
case . connected( _, . idle) ,
406
422
. connected( _, . waitingForNextInvocation) :
@@ -583,7 +599,9 @@ extension LambdaChannelHandler: ChannelInboundHandler {
583
599
continuation. resume ( returning: Invocation ( metadata: metadata, event: response. body ?? ByteBuffer ( ) ) )
584
600
} catch {
585
601
self . state = . connected( context, . closing)
586
- continuation. resume ( throwing: NewLambdaRuntimeError ( code: . invocationMissingMetadata, underlying: error) )
602
+ continuation. resume (
603
+ throwing: NewLambdaRuntimeError ( code: . invocationMissingMetadata, underlying: error)
604
+ )
587
605
}
588
606
589
607
case . connected( let context, . sentResponse( let continuation) ) :
0 commit comments