withInterruptibleSource

inline suspend fun <T> withInterruptibleSource(source: Source, crossinline block: (Source) -> T): T

Wraps source to support thread interruption while inside block.

Consumers should not read source inside block. Instead, read from the Source provided to block.