It looks like reading the body could be async (Byt...
# ktor
d
It looks like reading the body could be async (ByteReadChannel uses nio), so to send progress would be like this:
Copy code
val downloadedFile = downloadPath.resolve(url.path)
		var currBytes: Long = 0L

		downloadedFile.writeChannel().use {
			val content = client.get<HttpResponse>(url).content
			while (currBytes < totalSize) {
				currBytes += content.copyTo(this, bufferSize)
				progress.send(DownloadProgress(currBytes, totalSize))
			}
		}
@e5l?