https://kotlinlang.org logo
#coroutines
Title
# coroutines
k

kasper.kondzielski

03/14/2018, 11:48 AM
Hi I trying to wrap callback based api with coroutines. This api can fire multiple times so I am using channels. Now I am facing the problem that when user stops using channel my callback is still attached to the source. Is there any way to add onCancelListener to channel so I can cancel my internal callback?
e

elizarov

03/14/2018, 12:01 PM
Not yet, but there is a discussed enhancement that might help: https://github.com/Kotlin/kotlinx.coroutines/issues/260
2 Views