smallrye-mutiny icon indicating copy to clipboard operation
smallrye-mutiny copied to clipboard

`replaceWithUnit` for kotlin

Open MartinX3 opened this issue 2 years ago • 4 comments

Context

I'm using kotlin

Description

Offer a replaceWithUnit for kotlin users. It's better than using replaceWithVoid and replacing Void with Unit.

Additional details

Kotlin has Unit intead of Void.

MartinX3 avatar May 16 '22 09:05 MartinX3

@MartinX3 is on fire... Seems the mutiny-kotlin layer becomes somewhat urgent ;)

Do you have experience with such an overlay and are you willing to draft a proposal?

heubeck avatar May 16 '22 09:05 heubeck

Oh, I just use Quarkus in my Job and they officially switched to reactive with v2.8 and probably they will officially switch to kotlin as well in the future.

Sadly I have no experience in a kotlin overlay layer (but maybe it's easy) and I'm free time restricted with my job, studies and volunteer help as administrator in a sports club. :( Otherwise I would like to help.

MartinX3 avatar May 16 '22 10:05 MartinX3

Everything's fine ;) Then just keep collecting ideas, will have a look at some point in time :D

heubeck avatar May 16 '22 11:05 heubeck

Perfect and thank you :D

MartinX3 avatar May 16 '22 11:05 MartinX3

Hey @MartinX3 ,

what lasted long, eventually go shipped: https://smallrye.io/smallrye-mutiny/2.0.0/guides/kotlin/#unit-instead-of-void-null-value

Hope you will can make the upgrade to Mutiny 2 ;)

heubeck avatar Nov 28 '22 10:11 heubeck

Hey @heubeck, thank you for the hard work and mutiny 2.0 will be a great upgrade for quarkus. :)

Sadly my boss want's me since this month to migrate back to spring boot and it's data repositories, because of quarkus focus on the reactive way while spring still focuses on non reactive code. And reactive code is harder to read (including stacktraces) and hard to debug (aside from the missing kotlin syntactic sugar support in mutiny 1.7).

And I have no private project with quarkus (or any backend project at all).

MartinX3 avatar Nov 28 '22 11:11 MartinX3

That's indeed sad. With Quarkus/Kotlin-Coroutines you can get both: Reactive runtime efficiency and imperative coding style.

Just reach out, if you'd like to work on projects using stacks providing pure fun ;)

heubeck avatar Nov 28 '22 12:11 heubeck