Fudge
10/26/2019, 4:15 PMzak.taccardi
10/26/2019, 4:21 PMCasey Brooks
10/26/2019, 4:22 PMMain
dispatcher, to ensure that the UI state is consistent with the data being processed. Depending on what you’re needing to do, you may need to receive the event on the Main
dispatcher and then start a long-running task on a background dispatcher such as IO
zak.taccardi
10/26/2019, 4:22 PMFudge
10/26/2019, 4:24 PMzak.taccardi
10/26/2019, 4:24 PMDispatchers.Main
and everything else on Dispatchers.Default
. When using the default dispatcher, I use an ongoing Coroutine for thread safety. If there's blocking work, I use Dispatchers. IO
for that work<http://Dispatchers.IO|Dispatchers.IO>
for blocking IO workFudge
10/26/2019, 4:25 PMzak.taccardi
10/26/2019, 4:26 PM<http://Dispatchers.IO|Dispatchers.IO>
to read/write to the filesFudge
10/26/2019, 4:29 PMzak.taccardi
10/26/2019, 4:30 PMFudge
10/26/2019, 4:31 PMzak.taccardi
10/26/2019, 4:31 PMgildor
10/26/2019, 4:52 PMbasically what I have is the user gets an input popup, and while he types it parses some filesRead input on any dispatcher, probably Main, than dispatch heavy work to another dispatcher (Read/Write file on IO, some CPU bound processing on Default)