Dragos Rachieru
05/02/2022, 9:13 AMktor
for remote loading and okio
for local loading(files).
I want to have an interface for fetcher that returns a flow of Loading(progress)
, Success(something)
, Error(throwable)
I am not sure what something
should be to support both fetchers.ByteReadChannel
like in this library:
https://github.com/alialbaali/Kamel/blob/main/kamel-core/src/commonMain/kotlin/io/kamel/core/fetcher/HttpFetcher.ktPath
to load from files and support multiplatform, but I don't know how to create a ByteReadChannel
, I tried creating an extension for it based on File.readChannel
, but some of the methods are internal and I gave up in the end.Aleksei Tirman [JB]
05/08/2022, 3:48 PMjava.io.File
:
File("/path").readChannel()
or use a writer to write data to a channel:
val readChannel = GlobalScope.writer {
// channel.writeFully()
// channel.writeStringUtf8()
}.channel
Dragos Rachieru
05/09/2022, 11:33 AMByteReadChannel
but no luckAleksei Tirman [JB]
05/09/2022, 11:33 AMDragos Rachieru
05/09/2022, 11:52 AM