Skip to content

Add a transport for wrapping a NIO Channel #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 20, 2025

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented May 15, 2025

Motivation:

The NIO based client and transports want to fully manage the underlying NIO channels for you; creating them and tearing them down as necessary. However, in some instances users already have a NIO channel which they may also want to use a client. This might happen if they want to run gRPC within another protocol, for example.

Modifications:

  • Add a "wrapped channel" client transport which takes ownership of a NIO channel and configures the channels pipeline to do gRPC.
  • This is a different transport because a number of features aren't available such as reconnects and client-side load-balancing.

Result:

Users can wrap an existing NIO channel into a custom transport.

Motivation:

The NIO based client and transports want to fully manage the underlying
NIO channels for you; creating them and tearing them down as necessary.
However, in some instances users already have a NIO channel which they
may also want to use a client. This might happen if they want to run
gRPC within another protocol, for example.

Modifications:

- Add a "wrapped channel" client transport which takes ownership of a
  NIO channel and configures the channels pipeline to do gRPC.
- This is a different transport because a number of features aren't
  available such as reconnects and client-side load-balancing.

Result:

Users can wrap an existing NIO channel into a custom transport.
@glbrntt glbrntt added the 🆕 semver/minor Adds new public API. label May 15, 2025
@glbrntt glbrntt requested a review from gjcairo May 16, 2025 09:29
Copy link
Collaborator

@gjcairo gjcairo left a comment

Choose a reason for hiding this comment

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

LGTM, just two nits.

Co-authored-by: Gus Cairo <me@gustavocairo.com>
@glbrntt glbrntt enabled auto-merge (squash) May 20, 2025 15:15
@glbrntt glbrntt merged commit 53270f8 into grpc:main May 20, 2025
26 of 29 checks passed
@glbrntt glbrntt deleted the wrapped-channel branch May 20, 2025 16:11
dongjoon-hyun added a commit to apache/spark-connect-swift that referenced this pull request May 30, 2025
### What changes were proposed in this pull request?

This PR aims to upgrade `gRPC Swift NIO Transport` to 1.2.2 from 1.1.0.

### Why are the changes needed?

This brings the following improvements and bug fixes. Previously, 1.2.0 and 1.2.1 causes a crash in GitHub Action CI.
- https://github.com/grpc/grpc-swift-nio-transport/releases/tag/1.2.2
    - grpc/grpc-swift-nio-transport#110
- https://github.com/grpc/grpc-swift-nio-transport/releases/tag/1.2.1
- https://github.com/grpc/grpc-swift-nio-transport/releases/tag/1.2.0
    - grpc/grpc-swift-nio-transport#101
    - grpc/grpc-swift-nio-transport#103
    - grpc/grpc-swift-nio-transport#104

### Does this PR introduce _any_ user-facing change?

No behavior change.

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #185 from dongjoon-hyun/SPARK-52359.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants