pjfanning opened a new pull request, #1373: URL: https://github.com/apache/pekko-http/pull/1373
### Motivation The Java DSL `ServerSettings.Timeouts` only exposes `scala.concurrent.duration` types. Java users who set idle or request timeouts in code have to build Scala durations, e.g. `settings.getTimeouts().withIdleTimeout(scala.concurrent.duration.Duration.create(60, TimeUnit.SECONDS))`. `ClientConnectionSettings` and `ConnectionPoolSettings` already offer `java.time.Duration` variants. ### Modification - Add `getIdleTimeout`, `getRequestTimeout`, `getBindTimeout` and `getLingerTimeout` (returning `java.time.Duration`) to the javadsl `ServerSettings.Timeouts` trait. - Add `java.time.Duration` overloads of `withIdleTimeout`, `withRequestTimeout`, `withBindTimeout` and `withLingerTimeout`. - Infinite values map to and from `ChronoUnit.FOREVER.getDuration`, the same convention `ConnectionPoolSettings` uses. - The scaladsl `Timeouts` overrides the new `with*` overloads so it keeps its more specific return type. The existing Scala-typed methods are unchanged. ### Result Java users can read and set server timeouts with `java.time.Duration`. ### Tests - `sbt "http-core/Test/testOnly org.apache.pekko.http.javadsl.settings.ServerSettingsTest"` - passed (new tests for the getters, the setters and infinite handling) - `sbt http-core/mimaReportBinaryIssues` - passed - `sbt http-core/scalafmt http-core/Test/javafmt` - no changes ### References None - Java DSL cleanup of Scala types in public API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
