Skip to content

Conversation

sebsto
Copy link
Contributor

@sebsto sebsto commented Sep 1, 2025

Split the long LambdaRuntimeClient.swift file in two parts: the LambdaRuntimeClient and the LambdaChannelHandler for easier reading and maintenance

@sebsto sebsto requested a review from Copilot September 1, 2025 10:33
@sebsto sebsto self-assigned this Sep 1, 2025
@sebsto sebsto added the 🔨 semver/patch No public API change. label Sep 1, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Splits the LambdaRuntimeClient.swift file into two separate files to improve code organization and maintainability. The LambdaChannelHandler and related protocol definitions are moved to a dedicated file.

  • Extracts LambdaChannelHandler and related types to a separate file
  • Consolidates empty method implementation in LambdaRuntimeClient
  • Maintains all existing functionality while improving code readability

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
Sources/AWSLambdaRuntime/LambdaRuntimeClient.swift Removes extracted code and simplifies empty delegate method
Sources/AWSLambdaRuntime/LambdaRuntimeClient+ChannelHandler.swift Contains moved LambdaChannelHandler class and protocol definition

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

"user-agent": .userAgent,
"Lambda-Runtime-Function-Response-Mode": "streaming",
// these are not used by this runtime client at the moment
// FIXME: the eror handling should inject these headers in the streamed response to report mid-stream errors
Copy link
Preview

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment: 'eror' should be 'error'

Suggested change
// FIXME: the eror handling should inject these headers in the streamed response to report mid-stream errors
// FIXME: the error handling should inject these headers in the streamed response to report mid-stream errors

Copilot uses AI. Check for mistakes.

import NIOHTTP1
import NIOPosix

protocol LambdaChannelHandlerDelegate {
Copy link
Preview

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The protocol is no longer private after being moved to a separate file. Consider making it internal or add private to maintain the same access level as before.

Suggested change
protocol LambdaChannelHandlerDelegate {
private protocol LambdaChannelHandlerDelegate {

Copilot uses AI. Check for mistakes.

func connectionErrorHappened(_ error: any Error, channel: any Channel)
}

final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate> {
Copy link
Preview

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class is no longer private after being moved to a separate file. Consider making it internal or add private to maintain the same access level as before.

Suggested change
final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate> {
private final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate> {

Copilot uses AI. Check for mistakes.

@sebsto sebsto merged commit 53ec1cb into swift-server:main Sep 1, 2025
35 checks passed
@sebsto sebsto deleted the sebsto/split_runtime_client branch September 1, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant