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
coroutines
  • p

    Paulius Ruminas

    12/13/2019, 1:15 PM
    Hello,
    @Test
        fun example() = runBlocking {
            val a = produce {
                var i = 0
                while (isActive) {
                    send(i++)
                    delay(100)
                }
            }
            val b = a.broadcast(start = CoroutineStart.DEFAULT)
    
            launch {
                b.consumeEach {
                    println("A: $it")
                }
            }
            
            b.close()
    
            delay(1_000)
        }
    When I close b broadcast channel I get an exception:
    Exception in thread "Test worker @coroutine#3" kotlinx.coroutines.channels.ClosedSendChannelException: Channel was closed (Coroutine boundary)
    Is this the expected behavior?
    d
    a
    • 3
    • 7
  • v

    Vsevolod Tolstopyatov [JB]

    12/13/2019, 2:15 PM
    📣 📣 📣 
    kotlinx.coroutines
     version 1.3.3 is here! •
    Dispatchers.Main
    doesn’t use
    ServiceLoader
    anymore, preventing I/O on Main thread during initialization and annoying “Module with the Main dispatcher is missing” exceptions • Reworked
    Dispatchers.Default
    and
    <http://Dispatchers.IO|Dispatchers.IO>
    , CPU consumption is significantly reduced •
    Flow.merge
    operator • Significant performance improvements in
    Flow
    ,
    Channel
    and
    Job
    classes • Improved stacktrace recovery and debugging experience And a lot more, full changelog: https://github.com/Kotlin/kotlinx.coroutines/releases/tag/1.3.3
    👍 1
    🎉 43
    👏 1
    d
    • 2
    • 2
  • v

    voben

    12/13/2019, 10:49 PM
    If I want to reproduce the behavior of Rx PublishSubject by using a ConflatedChannel. Should I be using the
    offer
    or
    send
    function to send a value to the channel and why?
    z
    • 2
    • 2
  • a

    Anastasia Finogenova

    12/14/2019, 11:08 AM
    Trying to test my coroutines with unit tests (JUnit Mockito) and referring kotlin coroutines repo i was using runBlockingTest and it works as expected to advance the execution . But when I run tests concurrently in a suite they are flacky as they are sharing one dispatcher (my assumption) in view model. When looking at the repo there is TestCoroutineDispatcher but it looks like the API to replace actual dispatcher with that one is only .setMain which replaces Dispatchers.Main. I am using Dispatchers.IO so the mentioned api seems of no use . Is there a way to test coroutines with this set up without injecting the dispatcher into view model? @Test fun `test loadMenu calls interactor getMenu`() = runBlockingTest { viewModel.loadMenu() Mockito.verify(interactor).getMenu() } fun loadMenu() { viewModelScope.launch(Dispatchers.IO) { try { interactor.getMenu().menuDetails.menu.run { updateMainCatList(this) } } catch (ex: Throwable) { //todo handle exceptions } } }
    s
    b
    • 3
    • 15
  • r

    rrva

    12/14/2019, 11:49 AM
    if I have a java library that requires me to return a CompletionStage<T> for async calls, and I want to perform the call using a coroutine and then bridge back to java CompletionStage, how do I do that?
    v
    • 2
    • 2
  • c

    Czar

    12/14/2019, 4:08 PM
    Hi, I'm not very familiar with coroutines yet, but I'm doing a code review on code that uses them. I'm trying to figure out something:
    someList.map { async { /* stuff */ }.forEach { it.await() }
    My immediate reaction is to refactor it to
    someList.map { async { /* stuff */ }.awaitAll()
    But I see that
    awaitAll
    allocates an array, so am I actually hurting performance instead of improving things? Is
    forEach { it.await() }
    a more correct way to do
    await
    on a collection of
    Deferred
    ?
    a
    k
    j
    • 4
    • 34
  • b

    bjonnh

    12/15/2019, 1:36 AM
    is there a way to do fan-out but with flow?
    ➕ 1
    o
    • 2
    • 1
  • d

    dave08

    12/15/2019, 4:22 PM
    I'm probably missing something obvious... :rubber_duck:
    t
    • 2
    • 4
  • k

    karelpeeters

    12/15/2019, 6:35 PM
    Looks like
    ReceiveChannel.last()
    is deprecated, it links to https://github.com/Kotlin/kotlinx.coroutines/issues/254 but what do I actually have to replace it by?
    d
    k
    • 3
    • 5
  • k

    karelpeeters

    12/15/2019, 6:42 PM
    Similar question, how do I now connect the output of one channel to the input of another? I think
    output.consumeEach { input.send(it) }
    is correct but that's also deprecated.
    j
    d
    • 3
    • 10
  • o

    octylFractal

    12/15/2019, 6:44 PM
    in general, flows are the intended way to handle everything now. if you need a hot flow, take your channel and do
    chan.asFlow()
    first
    k
    d
    • 3
    • 2
  • c

    Colton Idle

    12/15/2019, 7:58 PM
    Okay. I haven't had any luck on adding exception handling to my coroutine. Anyone out there that knows how to prevent this from crashing?
    viewLifecycleOwner.lifecycleScope.launch {
    
            val work1 = async { getThingsDone(43) }
            val work2 = async { getThingsDoneAgain(123) }
            if (work1.await().isSuccessful && work2.await().isSuccessful) {
                //do my thing
            } else {
                //failure message
            }
    Basically, the getThingsDone calls are retrofit network calls. If one of them is still going on and I go into airplane mode, I get a crash. What have I tried? 1.
    try {
        viewLifecycleOwner.lifecycleScope.launch {
            val work1 = async { getThingsDone(43) }
            val work2 = async { getThingsDoneAgain(123) }
            if (work1.await().isSuccessful && work2.await().isSuccessful) {
                //do my thing
            } else {
                //failure message
            }
    } catch (e: Exception) {
    //show failure message
    }
    2.
    viewLifecycleOwner.lifecycleScope.launch {
                try {
                    val work1 = async { getThingsDone(43) }
                    val work2 = async { getThingsDoneAgain(123) }
                    if (work1.await().isSuccessful && work2.await().isSuccessful) {
                        //do my thing
                    } else {
                        //failure message
                    }
                } catch (e: Exception) {
                    //show failure message
                }
            }
    3.
    viewLifecycleOwner.lifecycleScope.launch {
            val work1 : Deferred<Response<MyType>>
            val work2: Deferred<Response<MyType>>
        try {
            work1 = async { getThingsDone(43) }
            work2 = async { getThingsDoneAgain(123) }
        } catch (e: Exception) {
            //show failure message
        }
            if (work1.await().isSuccessful && work2.await().isSuccessful) {
                //do my thing
            } else {
                //failure message
            }
    }
    4.
    viewLifecycleOwner.lifecycleScope.launch {
        val work1 = async {
            try {
                getThingsDone(43)
            } catch (e: Exception) {
                //show failure message
            }
        }
        val work2 = async {
            try {
                getThingsDoneAgain(123)
            } catch (e: Exception) {
                //show failure message
            }
        }
        
        if (work1.await().isSuccessful && work2.await().isSuccessful) {
            //do my thing
        } else {
            //failure message
        }
    }
    I would really appreciate some help. As of now this works super nice because I essentially have two async network calls, and my code ONLY continues if both of them complete! But in the off chance that I have a network error (or force one by going into airplane mode during the request), my Android app dies.
    s
    t
    p
    • 4
    • 8
  • t

    tjohnn

    12/16/2019, 3:04 PM
    Am I doing something wrong here? I am trying to use flow with firebase but I am getting
    kotlinx.coroutines.channels.ClosedSendChannelException: Channel was closed
    @ExperimentalCoroutinesApi
    fun <T> firebaseDataAsFlow(reference: DatabaseReference) = callbackFlow {
            reference.addValueEventListener(object : ValueEventListener {
    
                override fun onDataChange(dataSnapshot: DataSnapshot) {
                    val type = object : GenericTypeIndicator<T>() {}
                    offer(dataSnapshot.getValue(type))
                }
    
                override fun onCancelled(error: DatabaseError) {
                    cancel(CancellationException(error.details, error.toException()))
                }
    
            })
        }
    The exception gets thrown whenever
    offer()
    is called
    t
    v
    a
    • 4
    • 8
  • j

    Joseph PH

    12/17/2019, 11:07 AM
    Hello where and when should
    withLock{...}
    be applicable?
    b
    • 2
    • 1
  • j

    Joseph PH

    12/17/2019, 11:09 AM
    I am having some trouble fixing a race condition where there are multiple executions on the same function , I was thinking of adding a field marking the status of the object that is still in progress, but is there any other elegant way to address this?
    b
    l
    u
    • 4
    • 8
  • r

    rkeazor

    12/18/2019, 1:34 AM
    Kotlin coroutine actors are marked @ObsoleteCoroutinesApi , does this mean there is plans to replace it with something in the future?
    a
    z
    o
    • 4
    • 4
  • s

    seb

    12/18/2019, 7:48 AM
    guys, I want to ask for some help, I feel my problem is very simple but I'm struggling for a while now to find the right way to implement it. the pattern I'm trying to build is: I have a list of items. I want to 'process' the items with <n> concurrency and get a list of all the results back after everything is processed. Right now my attempt is • put all items in channel 'todo' • launch n workers that pull out of channel 'todo' and push the result of their processing into channel 'done' • collect all results from channel 'done' In the code snippet there is a simple example. It works, except for the "log progress" part. If I try to get channel.count() , the channel seems to get emptied. Which is by design, if I understand the docs correctly. But how else would I get the channels current number of items? Generally, is this correctly implemented for this pattern? I love kotlin, but for concurrency, there is waaay to many different ways to do things. All the contexts, dispatchers, channels, flows(?), async, jobs, consumer, etc etc ... Compared to e.g. golang, the concurrency is very complex.
    Untitled.kt
    o
    e
    j
    • 4
    • 37
  • l

    louiscad

    12/18/2019, 10:33 AM
    Can we expect a native-mt release based on 1.3.3? That'd be helpful to get the latest and greatest for projects sharing coroutines for iOS and Android (and macOS). Context: libraries in dev phase (#splitties) as I'm experimenting before adding an iOS sample.
    e
    u
    • 3
    • 5
  • d

    david.bilik

    12/18/2019, 1:58 PM
    Hi, I have a method in repository that is just calling some api request through retrofit and I want to solve a situation when this method is called multiple times at the same time and it fires multiple requests. Ideal solution for me would be to somehow reuse the same request while it runs. I’ve come up with this but I dont know if there are any problems or if it does not make sense at all. Thanks
    original function
    
    override suspend fun user(): User {
    	return api.user()
    }
    
    suggested solution
    
    var userDeferred: Deferred<User>? = null
    
    override suspend fun user(): User {
        if (userDeferred == null) {
            userDeferred = async {
                apiInteractor.user()
            }
        }
        return userDeferred.await().also {
            userDeferred = null
        }
    }
    u
    • 2
    • 3
  • b

    Brendan Weinstein

    12/18/2019, 11:27 PM
    For anyone looking to do an MVI ViewModel implemented just with Flow, I swapped in Flow for Rx from a pure Rx implementation. Rx version: https://github.com/kaushikgopal/movies-usf-android Flow version: https://github.com/brendanw/graphql-viewmodel/pull/1/files#diff-f7b91eff2ca316133c697563510a0e91 Flow is still missing a multicast operator, so I copied an implementation from some WIP open source lib by Yigit and Mike N. There is another multicast operator implementation by one of the Rx contributors; I tried it and experienced some heisenbugs -- Yigit and Mike's multicast flow operator has more comprehensive test coverage.
    l
    e
    m
    • 4
    • 7
  • v

    voben

    12/18/2019, 11:47 PM
    I’m using a channel in a viewmodel as a sort of BehaviorSubject. Do I need to explicitly close the channel when the viewmodel is cleared?
    l
    r
    • 3
    • 3
  • c

    colintheshots

    12/20/2019, 5:08 AM
    I'm trying to understand issues I noticed in the Default Dispatcher. At one point, I know this was backed by a pool similar to CommonPool with only threads = CPUs, coerced to at least 2 threads. What is the pool size today on JVM? I ran into issues not long ago where our app had been deadlocking on dependent work using the Default Dispatcher, but the same issue did not occur if I migrated the misplaced IO-bound work off to the IO dispatcher. The issues would only occur on the 1% of devices with the fewest cores, but the deadlock would extend for the full five second ANR interval on Android before I made the change. It seems like Dispatchers.Default must have a size smaller than the IO Dispatcher. This seems because Dispatchers.Default is still intended for CPU-bound work, like CommonPool. Is that correct or am I off-base?
    o
    l
    • 3
    • 8
  • r

    rattleshirt

    12/20/2019, 9:53 AM
    In the new native-mt model what would be the equivalent of Dispatchers.IO for iOS in a AppCoroutineDispatchers class with main = Main, computation = Default and io? Would that be
    newSingleThreadContext("io")
    ?
    g
    d
    • 3
    • 5
  • p

    Paul Woitaschek

    12/20/2019, 4:41 PM
    I remember this was asked a few times but I thought there was no definite answer: What is the equivalent of a rxjava PublishSubject? I need a non buffering channel that just ignores events when no one is listening
    b
    d
    • 3
    • 2
  • t

    Thiyagu

    12/20/2019, 8:51 PM
    Has anyone tried sqs message consumer using Kotlin flow???
    g
    • 2
    • 2
  • b

    bod

    12/21/2019, 4:19 PM
    Hello, World! I'm in a Multiplatform library and I'd like to use
    runBlocking
    ... is it possible?
    d
    • 2
    • 7
  • b

    bod

    12/21/2019, 5:40 PM
    So I managed to use
    runBlocking
    ... but now... it just freezes on iOS...
    d
    • 2
    • 1
  • a

    ansman

    12/21/2019, 8:14 PM
    So I have this weird problem where a flow’s collector is called when the scope is cancelled. I added some logging to confirm this is the case:
    val flow = repository
            .observeStuff(id)
            .map { it.map { it.createViewModel() }}
            .combine(otherFlow) { stuff, otherStuff -> stuff to otherStuff }
            // Don't emit until the settings are loaded
            .onEach { settingsLoading.join() }
            .conflate()
            .flowOn(Dispatchers.Default)
            .broadcastIn(viewModelScope, start = CoroutineStart.DEFAULT)
            .asFlow()
    
    scope.launch {
      flow.collect {
        // Rare crash because the scope is cancelled and the fragment is destroyed
        view.update(it)
      }
    }
    It really feels like it’s a bug in the coroutines framework because I can’t explain it otherwise I can fix it by adding a
    yield
    or
    if (coroutineContext[Job]?.isCancelled == true) throw CancellationException()
    in my
    collect
    but I really want to figure out what is happening. I’ve only seen it in Crashlytics I added some logging to crashlytics to confirm the scope is cancelled:
    CrashReporting.log("isStarted: %b, view == null: %b, isCancelled: %b".format(isStarted, view == null, coroutineContext[Job]!!.isCancelled))
    And in the crash report is says:
    isStarted: false, view == null: true, isCancelled: true
    o
    s
    • 3
    • 15
  • t

    tjohnn

    12/22/2019, 3:56 PM
    Does
    Flow.collect()
    block the parent coroutine from executing the code under the flow until the flow is cancelled?
    viewModelScope{
        // code here get executed
        someFlow.collect()
        // code here never executes
    }
    :yes: 1
    d
    p
    +2
    • 5
    • 5
  • c

    Colton Idle

    12/23/2019, 12:08 AM
    Still new with coroutines. I wrote the following code, but I get a warning that you can see in the screenshot. I'm assuming it's because nothing is telling
    fromJson()
    to do it's work in the background, but I don't think moshi has a suspend function for this? How would someone typically solve this?
    viewModelScope.launch {
        //Get from file
    
        try {
            val file = File(context.filesDir, "mycache")
            val contents = file.readText()
    
            val moshi = Moshi.Builder().build()
            val jsonAdapter = moshi.adapter(MyObject::class.java)
            val json = jsonAdapter.fromJson(contents)
            //DO SOMETHING
        } catch (e: Exception) {
    
        } finally {
        }
    }
    o
    d
    g
    • 4
    • 9
Powered by Linen
Title
c

Colton Idle

12/23/2019, 12:08 AM
Still new with coroutines. I wrote the following code, but I get a warning that you can see in the screenshot. I'm assuming it's because nothing is telling
fromJson()
to do it's work in the background, but I don't think moshi has a suspend function for this? How would someone typically solve this?
viewModelScope.launch {
    //Get from file

    try {
        val file = File(context.filesDir, "mycache")
        val contents = file.readText()

        val moshi = Moshi.Builder().build()
        val jsonAdapter = moshi.adapter(MyObject::class.java)
        val json = jsonAdapter.fromJson(contents)
        //DO SOMETHING
    } catch (e: Exception) {

    } finally {
    }
}
o

octylFractal

12/23/2019, 1:05 AM
wrap it in
withContext(<http://Dispatchers.IO|Dispatchers.IO>) { }
although I think intellij is being fooled by
fromJson
throwing IOException, as I doubt it does IO.
file.readText()
probably does though
c

Colton Idle

12/23/2019, 1:12 AM
Any way to check, or should I be okay wrapping it with
withContext{}
?
o

octylFractal

12/23/2019, 1:48 AM
javadoc? I imagine it takes a string, so it shouldn't do IO to read, but maybe the
jsonAdapter
does other things with global state that involve IO. I would guess that's not the case though
d

Dico

12/23/2019, 2:09 AM
I would put the file reading in io scope and suppress it for fromJson
g

gildor

12/23/2019, 12:55 PM
as I doubt it does IO
This warning is about blocking operation, not about only IO. Json creation is indeed potentially long operation even if it doesn't do any IO, so it make sense and it's not fooled. Wrapping to CPU bound dispatcher is not bad idea for serialization/deserialization
c

Colton Idle

12/24/2019, 9:16 AM
@gildor should I use Dispatchers.IO or is there another I should use?
g

gildor

12/24/2019, 9:22 AM
It depends, but Dispatchers.Default should be also fine because it's CPU bound
o

octylFractal

12/24/2019, 9:40 AM
note that the warning will only go away (without suppression) if you use
<http://Dispatchers.IO|Dispatchers.IO>
iirc
View count: 4