Hello! How to distinguish if cancellation come fro...
# coroutines
p
Hello! How to distinguish if cancellation come from parent or child?
l
Hello! What's your use case?
p
I'm sending message to channel and if channel. In case of catching exeption I want to understand if channel was canceled or current job.
l
Your first sentence isn't clear to me. Why do you want to "understand" if the channel was cancelled, or if the cancellation came from the job of a coroutine?
p
In case the channel was cancelled i need to create new and make some retry logic. In case of job canceled - just exit.
l
Looks like you want to use a
Flow
and an operator from the
xxxLatest
family.
🙏 1