nats-io / nats.java

Java client for NATS
Apache License 2.0
569 stars 154 forks source link

Add formal support for idiomatic Kotlin #935

Open matthewadams opened 1 year ago

matthewadams commented 1 year ago

Feature Request

Add support for idiomatic Kotlin use of NATS. This might entail creating a new repo nats.kotlin.

Use Case:

The primary use case is to leverage suspending functions wherever possible. Another nice use case is a more native feel when writing a NATS project in Kotlin, especially with respect to null safety.

Proposed Change:

Either a new repository nats.kotlin, or an addition to this repo for the artifact.

Who Benefits From The Change(s)?

All Kotlin developers using NATS.

Alternative Approaches

Continue using the Java API implemented in this repository.

scottf commented 1 year ago

Writing a client from scratch is a pretty large undertaking. I think a compromise would be to write a thin Kotlin wrapper. We've had a similar idea for Scala. The difficulty would then only be keeping it up to date.