I guess #2 is solved. Calling output.close() will ...
# coroutines
u
I guess #2 is solved. Calling output.close() will let switchMapped.toList() finish in the main coroutine which will close the receive channel, which is documented to cancel the producer. So I better add a termination point to the producer to not depend on this external closing