elizarov
fun <T> ReceiveChannel<T>.toListAsync(): Deferred<List<T>> = async { ArrayList<T>().also { list -> consumeEach { list.add(it) } } }