gildor
09/18/2018, 10:11 AMlouiscad
09/18/2018, 10:32 AMgildor
09/18/2018, 10:34 AMnull
as default value for progressgildor
09/18/2018, 10:36 AMgildor
09/18/2018, 10:37 AMDico
09/18/2018, 10:44 AMelizarov
09/18/2018, 10:45 AMwithContext
)gildor
09/18/2018, 10:58 AMDico
09/18/2018, 11:01 AMwithContext
, would probably use launch
instead to prevent it waitinggildor
09/18/2018, 11:04 AMDico
09/18/2018, 11:06 AMbj0
09/18/2018, 5:03 PMgildor
09/19/2018, 1:19 AMyou shouldn’t worry about creating new ones for that purposeYes, it just a couple of objects + work on dispatching of coroutine (that can involve context switching), but it depends on how often you notify progress, it may be that you have a lot of progress notifications and overheads of progress notifications will be visible. Overhead of channel is much higher, on each sent event you pay a few objects and atomic operations And channel is not so different for callback in this case
bj0
09/19/2018, 1:42 AMgildor
09/19/2018, 1:43 AMgildor
09/19/2018, 1:44 AMgildor
09/19/2018, 1:46 AMenough coroutines to have anything but negligible overheadAnd this is not a problem of coroutines, it’s just because channels is thread and concurrently safe abstraction
gildor
09/19/2018, 1:47 AMelizarov
09/19/2018, 7:05 AMDico
09/19/2018, 3:06 PMConflatedChannel
which will drop older elements and never suspend on send
calls.elizarov
09/19/2018, 3:13 PMDico
09/19/2018, 3:14 PM