rsocket/rsocket-kotlin

Support Kotlin 1.5+

darvld opened this issue · 2 comments

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()

Blocked upstream with ktor issue and native builds #168

Closing this as #168 adds support for Kotlin 1.5 (except on Native targets)