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

Improve Jetty server initializing for customization #4367

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

amccague
Copy link
Contributor

@amccague amccague commented Oct 3, 2024

Improve the ordering of the Jetty server initization so the configureServer step can configure the connections added by the server initializer

Subsystem
Ktor Server, Jetty Engine

Motivation
There is currently only limited means to customise the server created by the ktor server initializer.
Any logic in the configuration.configureServer block will always see 0 connections on the server. Whilst this is fine for adding custom connections it does not give any capacity to refine the configuration of the Jetty server connections created by Ktor.

It is possible to get the configured connections on the Jetty server, if the configure server block is executed after initializeServer().

Solution
Switch the ordering of the configuration.configureServer invocation so the ktor created connections are visible.

Improve the ordering of the Jetty server initization so the configureServer step can configure the connections added by the server initializer
@e5l e5l self-requested a review October 7, 2024 06:46
@e5l e5l merged commit 3c8d558 into ktorio:main Oct 7, 2024
9 of 12 checks passed
@e5l
Copy link
Member

e5l commented Oct 7, 2024

Hey @amccague, thank you for the PR!

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants