By the way, it seems like you are using a producer...
# coroutines
j
By the way, it seems like you are using a producer pattern. I would personally suggest this method signature :
private fun startProcessingIncomingData(): ReceiveChannel<Segment> = produce { /* do stuff */ send(segment) }