Skip to content
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

Add a server debug channel initializer #911

Merged
merged 1 commit into from
Jul 28, 2020

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Jul 27, 2020

Motivation:

Sometimes it's helpful to be able to add additional handlers to the
channel pipeline. We let clients to do this, so we should let servers do
it too.

Modifications:

  • Add a debugChannelInitializer to server configuration and the server
    builder

Result:

  • Users can add additional channel handlers to servers

@glbrntt glbrntt added the 🆕 semver/minor Adds new public API. label Jul 27, 2020
@glbrntt glbrntt requested a review from Lukasa July 27, 2020 12:14
Copy link
Collaborator

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Two notes on the comments, otherwise LGTM.

/// This may be used to add additional handlers to the pipeline and is intended for debugging.
/// This is analogous to `NIO.ServerBootstrap.childChannelInitializer`.
///
/// - Warning: The initializer closure may be invoked *multiple times*.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Strictly this one is invoked no more than once per connection.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point; I added clarification.

/// This may be used to add additional handlers to the pipeline and is intended for debugging.
/// This is analogous to `NIO.ServerBootstrap.childChannelInitializer`.
///
/// - Warning: The initializer closure may be invoked *multiple times*.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same note here.

Motivation:

Sometimes it's helpful to be able to add additional handlers to the
channel pipeline. We let clients to do this, so we should let servers do
it too.

Modifications:

- Add a `debugChannelInitializer` to server configuration and the server
  builder

Result:

- Users can add additional channel handlers to servers
@glbrntt glbrntt force-pushed the gb-debug-init-server branch from 7a32b51 to e2204a0 Compare July 28, 2020 10:58
@glbrntt glbrntt merged commit 72a6aca into grpc:master Jul 28, 2020
@glbrntt glbrntt deleted the gb-debug-init-server branch July 28, 2020 11:56
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