w

    wellingtoncosta

    2 years ago
    Hi! How can I use
    reaktive
    with
    ktor
    for http calls?
    Arkadii Ivanov

    Arkadii Ivanov

    2 years ago
    Hello! Please read the following section of the README: https://github.com/badoo/Reaktive#coroutines-interop In general, Ktor crashes in multi-threaded environment. Assuming you are using the full multi-threading power of Reaktive, it's quite easy to freeze Ktor Client by accident in Kotlin/Native, so it will crash. I really recommend to avoid using Ktor currently and replace with a simple expect/actual. But if you have to use Ktor, then you can try the provided in the README "unsafe" solution.
    saket

    saket

    2 years ago
    is there an issuetracker page for this that I can follow on ktor’s github?
    w

    wellingtoncosta

    2 years ago
    Hello, Arkadii! I read this section, but it wasn’t clear to me. Now I confirmed what I had understood. In this case, I need to implement my networking layer using the standard HTTP API of the target (
    HttpUrlConnection
    for Java / Kotlin and
    NSURLConnection
    for iOS)?
    Arkadii Ivanov

    Arkadii Ivanov

    2 years ago
    Yes this would be a perfect solution from my point of view! You can derive your implementation from my article: https://badootech.badoo.com/mvi-in-kotlin-multiplatform-part-2-2-of-3-3faab535de02?source=friends_link&sk=a7a347e49202e139d5cd7533d2a97141 Checkout the "Implementing KittenDataSource" section.
    saket

    saket

    2 years ago
    this is such a nice illustration
    w

    wellingtoncosta

    2 years ago
    Thanks @Arkadii Ivanov!
    saket

    saket

    2 years ago
    For Android we are using HttpUrlConnection, again this is a popular way of loading data in Android.
    @Arkadii Ivanov I don’t think anyone
    HttpUrlConnection
    anymore 😛
    Arkadii Ivanov

    Arkadii Ivanov

    2 years ago
    @saket
    this is such a nice illustration
    Thanks! We were working hard on this)))
    I don’t think anyone 
    HttpUrlConnection
     anymore
    Well, I think this is the common way for low level networking, isn't it? Of course you can use Retrofit or other frameworks 😃
    saket

    saket

    2 years ago
    right everyone uses some abstraction on top of httpurlconnection
    @Arkadii Ivanov can badoo release a high-res version of this illustration by any chances? It’d make for a good wallpaper.
    Arkadii Ivanov

    Arkadii Ivanov

    2 years ago
    I will ask!
    Viola!
    Sorry for spamming 😃
    saket

    saket

    2 years ago
    Awesome. Any chances
    part 1
    and
    business logic
    be removed/changed? They’d look weird in wallpapers lol.
    Arkadii Ivanov

    Arkadii Ivanov

    2 years ago
    Will PM you