https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
spring
  • r

    Robert Jaros

    08/18/2021, 7:49 AM
    Can I somehow use suspending functions with Spring Quartz scheduler without
    runBlocking {}
    ?
    j
    • 2
    • 1
  • e

    efemoney

    08/18/2021, 10:41 AM
    Request handler methods do not support
    value class
    es as arguments. i’m seeing this exception (stacktrace in thread):
    IllegalArgumentException: object is not an instance of declaring class
    • 1
    • 2
  • d

    Dirk

    08/21/2021, 7:52 PM
    Hey guys. Does anybody know how I can define and use a method in a DTO? The DTO is proxied by Spring data projection (by a native query). It seems to not recognize my method I defined in the interface.
    Null return value from advice does not match primitive return type for: public abstract double <DTONAME>.<METHOD>()
    r
    • 2
    • 5
  • n

    Neil

    09/09/2021, 10:19 AM
    Hi. Are we supposed to be able to return a kotlin Sequence from a spring-data query? Not finding much on Google...
    r
    j
    • 3
    • 3
  • n

    nfrankel

    09/12/2021, 9:01 PM
    https://blog.frankel.ch/annotation-free-spring/
    👍 6
    👍🏼 1
    👌 1
    k
    • 2
    • 7
  • v

    viralshah

    09/20/2021, 4:18 PM
    Hey guys, I was wondering if there were any examples with Spring R2dbc + postgres interval data type, I am trying to find a way to read and write interval values but can’t find anything so far
    r
    • 2
    • 1
  • n

    Nick Halase

    09/23/2021, 10:24 PM
    How well does Spring support following the official Kotlin coding convention for directory structure? Does package scanning still work correctly using a pure Kotlin directory/package structure?
    n
    k
    h
    • 4
    • 4
  • g

    gotoOla

    09/24/2021, 8:44 AM
    Is there anyway in spring + kotlin do to a mixed constructor where you have e.g.
    @Service
    class MyClass(
       myService: MyService, // autowired
       helper: Helper = Helper("defaultValue") // just get default value but somebody could override this in e.g. tests
    )
    ?
    n
    t
    k
    • 4
    • 3
  • m

    Michael Strasser

    09/29/2021, 1:05 AM
    Hey Spring users, I am creating the Klogging logging library in Kotlin. There is also an SLF4J binding and a Spring Boot Starter. Currently it supports Splunk, Graylog and Seq destinations directly. Let me know if you try it and if you find it useful (or not!).
    ❤️ 4
    k
    j
    • 3
    • 4
  • b

    Ben Madore

    10/06/2021, 3:33 PM
    i’m sure i’m just doing something silly, but i’ve got a spring boot project containing:
    src/main/kotlin/com/foo/Blah.java
    src/main/kotlin/com/foo/bar/WebController.kt
    WebController instantiates and uses a Blah. at compile time, no issues. when i start the app with
    gradle bootRun
    - at runtime i get:
    java.lang.NoClassDefFoundError: com/foo/Blah
    i shouldn’t have to do anything special to make sure the java classes are on the classpath, right?
    t
    • 2
    • 7
  • r

    Robert Jaros

    10/10/2021, 6:24 AM
    When running spring webflux app with kotlinx.serialization enabled I get
    500 Internal Server Error
    when there is a problem with deserialization (e.g. missing key in the request data). When using jackson serialization with the same data the error is
    400 Bad Request
    . Can I somehow configure the returned error for kotlinx.serialization?
    h
    t
    e
    • 4
    • 7
  • t

    thanksforallthefish

    10/12/2021, 6:52 AM
    @Emil Kantis https://kotlinlang.slack.com/archives/C0B8ZTWE4/p1634020951040300?thread_ts=1633847081.037300&amp;cid=C0B8ZTWE4 interesting example, I guess I never tried with
    Int
    . with
    String
    you get an exception, I guess it might be the compiler unwrapping
    Int
    to
    integer
    (compared to
    Integer
    ), where
    null == 0
    also in plain java. your second example needs a bit of configuration of the kotlin module,
    jacksonObjectMapper().registerModule(KotlinModule(nullIsSameAsDefault = true))
    (moved we don’t spam uninterested people)
    👍 1
    e
    • 2
    • 5
  • k

    Kilian Steenman

    10/18/2021, 5:11 PM
    Hi all, got a spring/kotlin specific question. What is the best way to deal with parameters that might be nullable in some controllers and non null in others? For example; I’ve written a converter for the
    CountryCode
    which converts a String to a CountryCode. If this value is not there or invalid it will return a 400 “InvalidParameter”. But if I make the value nullable, the value should just be null when it’s missing or invalid.
    @RequestParam(value = "country") countryCode: CountryCode // Should throw an exception when invalid or missing
    @RequestParam(value = "country") countryCode: CountryCode? // Should be null when invalid or missing
    Is there a way to create separate converters for the nullable and non nullable implementations? (Probably not because it’s not actually a different type?) By just returning null in the converter I will get:
    Required request header 'country' for method parameter type CountryCode is present but converted to null
    Which feels like its leaking some information to the outside world which they don’t need to know about. I could make the param an
    Optional<CountryCode>
    for the nullable case, map the message of the exception or do the mapping from String to CountryCode in the controller function. But those options all feel less nice. Is there a completely different solution I didn’t think of?
    n
    t
    t
    • 4
    • 5
  • e

    Emil Kantis

    10/19/2021, 5:59 PM
    I'm creating a REST-client with a
    @Cacheable
    method. Since
    @Cacheable
    is broken for suspend functions, I tried to do this with reactor-types for the specific method instead. Looks something like this:
    @Cacheable("my-cache")
    fun fetchThing(key: String): Mono<Thing> = 
      webClient.get("/thing/{key}", key)
        .retrieve()
        .bodyToMono()
    Now, in the code where I use this. I want to bridge back into awesome realm of suspend (😉), so I do:
    restClient.fetchThing(key).awaitSingle()
    . However, it seems that invoking
    awaitSingle()
    twice on a
    Mono
    created this way will actually cause the webrequest to fire again, instead of lazily returning the already existing result in the
    Mono
    .. Does anyone know the proper way to get back to suspend functions after creating a Mono like this? Should I map the mono to a lazy mono of first result or something?
    n
    • 2
    • 12
  • t

    thanksforallthefish

    11/03/2021, 2:49 PM
    I have an issue with kotlin
    Result
    and AOP
    package com.example.demo
    
    import org.aspectj.lang.ProceedingJoinPoint
    import org.aspectj.lang.annotation.Around
    import org.aspectj.lang.annotation.Aspect
    import org.springframework.boot.autoconfigure.SpringBootApplication
    import org.springframework.boot.runApplication
    import org.springframework.stereotype.Component
    import org.springframework.web.bind.annotation.GetMapping
    import org.springframework.web.bind.annotation.RequestMapping
    import org.springframework.web.bind.annotation.RequestParam
    import org.springframework.web.bind.annotation.RestController
    
    @SpringBootApplication
    class DemoApplication
    
    fun main(args: Array<String>) {
    	runApplication<DemoApplication>(*args)
    }
    
    @RestController
    @RequestMapping("/test")
    class TestController(val repository: TestRepository) {
    	@GetMapping
    	fun test(@RequestParam(defaultValue = "#{{}}") list: List<Int>) =
    		repository.getList(list)
    				.getOrElse { list }
    }
    
    @Component
    class TestRepository {
    	fun getList(list: List<Int>): Result<List<Int>> = runCatching { throw RuntimeException("Error") }
    }
    
    @Aspect
    @Component
    open class MyOhMy {
    	@Around("within(com.example.demo..*Repository+)")
    	fun aspect(joinPoint: ProceedingJoinPoint): Any? =
    			joinPoint.runCatching {
    				proceed()
    			}.getOrThrow()
    }
    issue is that
    getOrThrow
    in the aspect actually throws, while I would expect to return a
    Result<Failure
    more in thread
    d
    • 2
    • 8
  • e

    Emil Kantis

    11/24/2021, 11:07 AM
    Has anyone managed to get a WebFlux controller working with value classes? I get the error
    object is not an instance of declaring class
    when trying to use a
    @PathVariable
    that is a value class.
    r
    • 2
    • 2
  • j

    Jilles Soeters

    11/24/2021, 4:37 PM
    🧵 - Where do y’all put your extension functions? I have some protobufs in my gRPC service. Some people are writing extension functions for these protos in the
    @Service
    component, some in models.kt. I’ve seen extensions.kt in other places… Wdyt?
    j
    n
    • 3
    • 2
  • x

    xii

    11/25/2021, 4:59 PM
    when validating a controller using kotlin/spring, how would you validate that a date is after the other? I tried creating a data class and having an
    @AssertTrue
    in the data class, but I'm getting an unused function error (🧵 )
    j
    t
    • 3
    • 7
  • j

    Júlio Santos

    12/07/2021, 7:10 PM
    Talk about guys! Do you happen to have any material on the differences between Spring and Ktor? Please
    b
    r
    • 3
    • 2
  • l

    Leonardo Borges

    12/10/2021, 11:32 AM
    Guys, I have a property in
    application.yaml
    which is set like
    maxRetries: ${MAX_RETRIES:3}
    where
    MAX_RETRIES
    is set as an env var. I'm using Spring to map the properties using
    @ConfigurationProperties
    . This particular variable is
    UByte
    and since it is kotlin, Spring can't map it. Any clues how to convert it properly?
    j
    • 2
    • 3
  • r

    Robert

    12/13/2021, 7:19 AM
    Hey guys, what’s the preferred way to use configuration-metadata-annotation-processor with kotlin? As KAPT is scheduled for deprecation and increases build time … ?
    ❤️ 1
    b
    • 2
    • 2
  • p

    Philipp Mayer

    12/15/2021, 3:51 PM
    Out of curiosity, did anyone of you play around with supplying lambdas as beans? I’m talking about the following:
    @Configuration
    class MyConfig {
        @Bean
        fun sendAnEmail(emailPublisher: EmailPubSubPublisher) = sendAnEmailLambdaVersion(emailPublisher)
    }
    
    fun sendAnEmailLambdaVersion(emailPublisher: EmailPubSubPublisher): (SomeEmail) -> Mono<String> =
        { email: SomeEmail -> emailPublisher.send(email) }
    sure it works, but throwing
    @Bean
    on the function directly would be ofc more elegant, but I’m currently making no progress in that direction. Does anyone have any experience with that? Thanks! 🙂
    s
    • 2
    • 5
  • s

    sdeleuze

    12/28/2021, 2:03 PM
    FYI I am collaborating with Kotlin team to tentatively remove
    kotlin-reflect
    dependency from Spring Boot 3 applications and use a more lightweight Kotlin reflection alternative, I will share more on that as we make progress.
    ❤️ 10
    👍🏼 1
    🎉 3
    👍 3
    t
    • 2
    • 1
  • x

    xii

    12/28/2021, 3:36 PM
    does this ring a bell for anybody?
    s
    j
    c
    • 4
    • 21
  • d

    dany giguere

    01/06/2022, 5:52 PM
    anyone could tell me what’s wrong with this
    existingUser.copy(username...
    here :
    package com.example.app.controllers
    
    import com.example.app.models.User
    import com.example.app.repositories.UserRepository
    import org.springframework.http.HttpStatus
    import org.springframework.http.ResponseEntity
    import org.springframework.web.bind.annotation.*
    import java.util.*
    import javax.validation.Valid
    
    @RestController
    @RequestMapping("/api")
    class UserController(private val userRepository: UserRepository) {
    
        @PutMapping("/users/{id}")
        fun updateUserById(@PathVariable(value = "id") userId: Long,
                              @Valid @RequestBody newUser: User): ResponseEntity<User> {
            return userRepository.findById(userId).map { existingUser ->
                val updatedUser: User = existingUser.copy(username = newUser.username)
                ResponseEntity.ok().body(userRepository.save(updatedUser))
            }.orElse(ResponseEntity.notFound().build())
        }
    I get this compiling error:
    Unresolved reference: copy
    k
    • 2
    • 3
  • d

    dany giguere

    01/06/2022, 10:07 PM
    and then would it be possible to load them (optionnaly) within the controller ?
    t
    k
    +2
    • 5
    • 20
  • q

    quiqua

    01/08/2022, 2:43 PM
    Hej! If I have a SQL table that defines such a table
    CREATE TABLE elements (
      id SERIAL PRIMARY KEY,
      resource_id VARCHAR(50) UNIQUE DEFAULT uuid_generate_v4(),
      name VARCHAR(100) NOT NULL
    )
    and a class like
    @Entity
    @Table(name = "elements")
    data class Element(
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Column
        var id: Int?,
        @Column
        var resourceId: String?,
        @Column
        var name: String?
    )
    How can I only create new objects via
    val elem = Element(name="foo")
    and let the rest be automatically created via JPA/Hibernate Is that even possible in my case? Do I just need different constructors then?
    j
    • 2
    • 2
  • s

    Sushruth Nagaraj

    01/10/2022, 4:21 AM
    Hey everyone, I'm looking for suggestions, as a part of a database management systems course in my engineering college, I've to build a mini project to demonstrate the various concepts like create, update and query on the database etc. I've decided to build a dog adoption system. Basically, there are two types of users, 1). admin - posts the details of the dogs, maintains the record of users and dogs, processes the requests of dogs by the user, etc. 2). user- creates a profile, views a list of dogs, requests for dogs and waits for the confirmation, etc(I've attached the ER diagram below, any suggestions are welcomed). I've thought of using MySQL as the database management system, Spring Boot (Spring MVC, Spring Security, Thymeleaf, JDBC API and optionally Vaadin) I don't think I can use an ORM or API's like Spring Data JPA and I'll have to work with pure SQL queries and statements. I'm finding it hard to look for examples and resources for the same, any help would be appreciated. Thanks.
    j
    t
    c
    • 4
    • 12
  • g

    Goldcrest

    01/12/2022, 7:52 AM
    Hello, I was wondering if I could replace the usual Spring MVC
    @Scheduled
    annotation with Reactive Spring + Webflux’s
    Flux.interval
    method. Is this approach sane? Thanks in advance!
    :not-kotlin: 2
    j
    • 2
    • 1
  • j

    jbnizet

    01/13/2022, 2:39 PM
    Hi. I’m just starting learning coroutines and tried to apply them on a simple imaginary use-case involving using the Spring WebClient (which supports coroutines). I have a web server accepting GET requests, and responding the current time to each request after a delay of 2 seconds (to test parallelism). My goal is to send 10 requests to this server, but to limit the number of concurrent requests to 3 (to avoid spamming it). With reactive code, this can be achieved using
    fun run(vararg args: String?) {
            (1..10).toFlux()
                .flatMap({ this.get() }, 3)
                .collectList()
                .block()
                ?.forEach { println(it) }
        }
    
        private fun get(): Mono<String> {
            return webClient.get()
                .uri("/foo")
                .retrieve()
                .bodyToMono<String>()
        }
    s
    s
    • 3
    • 10
Powered by Linen
Title
j

jbnizet

01/13/2022, 2:39 PM
Hi. I’m just starting learning coroutines and tried to apply them on a simple imaginary use-case involving using the Spring WebClient (which supports coroutines). I have a web server accepting GET requests, and responding the current time to each request after a delay of 2 seconds (to test parallelism). My goal is to send 10 requests to this server, but to limit the number of concurrent requests to 3 (to avoid spamming it). With reactive code, this can be achieved using
fun run(vararg args: String?) {
        (1..10).toFlux()
            .flatMap({ this.get() }, 3)
            .collectList()
            .block()
            ?.forEach { println(it) }
    }

    private fun get(): Mono<String> {
        return webClient.get()
            .uri("/foo")
            .retrieve()
            .bodyToMono<String>()
    }
How to do that with coroutines? I managed to do using
withContext(<http://Dispatchers.IO|Dispatchers.IO>.limitedParallelism(3))
and by making each request block the current thread, but it defeats the purpose of using coroutines, doesn’t it?
s

Szymon Jeziorski

01/13/2022, 6:07 PM
Project Reactor and Spring WebFlux have their kotlin extensions as
awaitBody()
,
awaitSingle()
awaitExchenge()
etc. to integrate Reactor reactive flow with kotlinx.coroutines. Please read: https://spring.io/blog/2019/04/12/going-reactive-with-spring-coroutines-and-kotlin-flow https://github.com/Kotlin/kotlinx.coroutines/tree/master/reactive/kotlinx-coroutines-reactor https://github.com/Kotlin/kotlinx.coroutines/tree/master/reactive/kotlinx-coroutines-reactive
s

sdeleuze

01/13/2022, 8:11 PM
Hey JB, check also Flow documentation like https://kotlinlang.org/docs/flow.html#flows, Spring extensions are listed in https://docs.spring.io/spring-framework/docs/current/kdoc-api/.
j

jbnizet

01/13/2022, 8:46 PM
Thank. I know about awaitBody, but that’s the point of my question: using it instead of blocking, how can I limit the concurrency (i.e. make sure only 3 requests are handled at once by the server)?
I know flows exist, even though I don’t really master them at all, but their usage seems very similar to the usage of Flux (which I know better), so if I have to use a reactive way of programming, I can do that with Flux directly.
Maybe some code would help. This does what I want, but seems silly:
fun run() {
        runBlocking {
            withContext(Dispatchers.IO.limitedParallelism(3)) {
                (1..10).map {
                    async { get() }
                }.forEach { println(it.await()) }
            }
        }
    }

    private fun get(): String {
        val body = webClient.get()
            .uri("/foo")
            .retrieve()
            .bodyToMono<String>()
            .block()!!
        return body
    }
But replacing get() by this implementation sends all the requests at once:
private suspend fun get(): String {
        return webClient.get()
            .uri("/foo")
            .retrieve()
            .awaitBody()
    }
s

sdeleuze

01/13/2022, 8:56 PM
See https://github.com/Kotlin/kotlinx.coroutines/issues/1147 which is still not fixed.
See also https://github.com/Kotlin/kotlinx.coroutines/issues/1147#issuecomment-487531313
j

jbnizet

01/14/2022, 1:40 PM
Thank you all. My understanding is that, for this use-case, I’d better stick to the reactor API rather than use coroutines. I’m fine with it, but since I’m in the early stages of learning coroutines, I wonder if I’m missing something.
s

sdeleuze

01/14/2022, 5:03 PM
I am not a Coroutines expert either, but yeah I think this aspect of Coroutines is not mature yet, and I was surprised as well when I discovered it (coming from Reactive). My guess the Kotlin team has a lot of priorities to manage in parrallel.
View count: 7