Rob Elliot
03/14/2025, 10:13 AMkotlinx.io.asSource
returns a RawSource
, which is not a Source
.
Have you considered renaming it to kotlinx.io.asRawSource
, and making kotlinx.io.asSource
syntactic sugar for .asRawSource().buffered()
?Rob Elliot
03/14/2025, 10:14 AMasSink
, of course)Filipp Zhinkin
03/14/2025, 12:38 PMasSource
returns RawSource
. The return type was chosen as a more universal one, and the name as a nicer one. And there is no function returning Source
as it seems trivial to construct it.
It might be worth giving it a second thought before stabilizing the library.Rob Elliot
03/14/2025, 1:05 PMSource
rather than a RawSource
? Not sure what best practice is there.Filipp Zhinkin
03/14/2025, 3:23 PMSource
and Sink
instead of their Raw ancestors. And from that perspective it makes more sense to provide extensions that return these buffered types directly, without a need to call .buffered()
on them.