Support Kotlin 1.5+
darvld opened this issue · 2 comments
darvld commented
Currently, in order to configure the Ktor client, some internal classes use an obsolete API for Duration handling, specifically, the KeepAlive constructor uses a syntax like 30.seconds
, which was removed from the Kotlin stdlib. This causes an immediate exception when configuring a client.
Steps to Reproduce
Simply configure a Ktor client and add support for RSocket. It will immediately fail with an exception saying it can't find some method.
@Test
public void reproCase() {
val client = HttpClient(CIO) {
install(WebSockets.Feature)
install(RSocketSupport)
}
}
Solution
Update to the new API, using Duration.seconds()
and Duration.minutes()
instead of Int.seconds()