smallrye / smallrye-mutiny

An Intuitive Event-Driven Reactive Programming Library for Java
https://smallrye.io/smallrye-mutiny
Apache License 2.0
798 stars 125 forks source link

Kotlin types are lost on specific operations #913

Open MartinX3 opened 2 years ago

MartinX3 commented 2 years ago

With kotlin and smallyre sometimes I need to declare the type again.

Additional details

Examples:

Maybe we need kotlin classes as a layer in smallrye which optimize the kotlin compatibility? As far as I know the Quarkus Framework uses this approach.

PS: I like the word confusing

heubeck commented 2 years ago

Like the idea and would love to investigate, unfortunately, I'm blocked for the next month. @MartinX3 how about meet at https://www.cloudland.org/ and discuss in person? ;)

MartinX3 commented 2 years ago

@heubeck Sadly it's too expensive for me and I use Mutiny only for my job. I don't use it in my volunteer tasks and my studies, so I also don't have time as well.

I found a new issue It needs the type for the mapping function. So .map(List<Double>::average) and .map { it.average() } are working, but .map(::average) throws an error.

    fun findAverageScoreByA(id: UUID): Uni<Double> =
        stream("b.aId", id).group().by { it.category.name }
            .onItem().transformToUniAndMerge { it.collect().asList() }.map { it.map(b::score).average() }
            .collect().asList().map(List<Double>::average)
heubeck commented 2 years ago

Thanks @MartinX3 , no issue, my own organization has a way to go as well in regards of official support on OSS contributions.

Just keep reporting, will care as soon as possible.