Vlad
06/20/2019, 11:11 AMZach Klippenstein (he/him) [MOD]
06/20/2019, 4:07 PMtokenChannel
to be a channel – you’re never actually receiving from it. It can just be a simple AtomicReference
.Vlad
06/20/2019, 6:45 PMZach Klippenstein (he/him) [MOD]
06/20/2019, 6:58 PMZach Klippenstein (he/him) [MOD]
06/20/2019, 7:00 PMtokenUpdateJob
coroutine throws an exception? You might want to wrap it in a try/catch and close the channel if there’s an error. Although if the channel consumer shares a parent CoroutineScope, structured concurrency should take care of cancelling everything anyway.