Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

Decide on future of Kotlin support #3

Open
Aaron1011 opened this issue Jul 17, 2018 · 1 comment
Open

Decide on future of Kotlin support #3

Aaron1011 opened this issue Jul 17, 2018 · 1 comment

Comments

@Aaron1011
Copy link
Contributor

I really like being able to write tests in Kotlin using coroutines. However, supporting both normal and coroutine tests imposes a non-trivial maintenance burden:

Specifically, any blocking method - which includes every single method in Client - needs to be duplicated. I don't see any way of getting around this - normal Java code can't call a suspend function, and Kotlin code has to call a suspend function if it wants to avoid blocking.

I see two ways forward:

  • Continue to support both Kotlin and Java. We'll have to try and reduce the confusion over which methods to use, however.
  • Drop Java support, and only support writing tests in Kotlin. While this would simplify the API and implementation, it would impose a non-trivial barrier for users looking to get started with McTester. For people with no experience with Kotlin, they would need to learn (parts of) a new language to even write a simple test.

From what I've seen, there doesn't seem to be any way of making a single suspendable method callable from both Java and kotlin - and to make it block when called from Java, and suspend when called from Kotlin. If anyone knows of a way to accomplish this, it would be incredibly helpful.

@randombyte-developer
Copy link

https://discuss.kotlinlang.org/ is a great place to ask those questions. I also asked this there.

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

No branches or pull requests

2 participants