Open lizmat opened 9 months ago
But how would it decide how big the blobs should be?
Whatever IO::Handle.READ
returns :-)
Whatever IO::Handle.READ returns :-)
Does that use read(2)
or fread(3)
semantics? I have a memory of it doing the latter, which would be unusable; I may be mistaken.
Basically, does it retry when getting less than $wanted
bytes or not. It truly shouldn't.
nqp::readfh($!PIO,nqp::create(buf8.^pun),$bytes)
I'm not sure about the semantics, but probably with retry. Not sure what the backends provide.
FWIW, I think an iterator should use READ
semantics.
OTOH, a supply
based on asyncreadbytes
would be the truly lazy approach.
Just as
.lines
provides a lazySeq
of lines, I think it would be worthwhile to have a lazySeq
ofbuf8
/blob8
objects of a file. This could be helpful in some workflows where serially decoding a (large) file is the bottleneck. Using.blobs
would give the opportunity to only need to decode those parts one is actually interested in.