Or should I be shoving this !effect into some othe...
# arrow
k
Or should I be shoving this !effect into some other thread/dispatcher/process like one might in Android with
launch(<http://Dispatchers.IO|Dispatchers.IO>)
or something? (This is a Kotlin command line program I’m working on)
s
Yes, you can do the same thing with
effect
. What you want to use here is.
Copy code
effect(IO.dispatchers().io()) { ImageIO.read(file) }
Which is an alias for
IO(IO.dispatchers().io()) { ... }
You can also use things such as
continueOn
,
shift
to perform concurrent switching or use any of the parallel operators to run
IO
in certain `CoroutineContext`s.
Does it still give the lint warning if you rewrite to this? I’m hoping to build some IDE tooling for Arrow Fx in 2020
s
message has been deleted
I hope I'm using Bracket right 😂
s
That is absolutely correct