Open stuartpb opened 7 years ago
The simplest way I can think to do this is to add a bottleneck on the stream going into the DecodeStream that breaks each chunk into a series of chunks byte-by-byte, then unpipes after the finishing byte that causes an object to be emitted.
However, I'm wondering if there's another way, such as a modification to the flush
method (and/or the fetch
method) that would allow for another method that could be called to get any buffered data that ha yet to be flushed, in the middle of the first call of the DecodeStream's data
callback.
The dryrun
measuring feature described in #40 could also be useful here.
I'm looking at the streaming interface, but one thing isn't clear to me: is it possible to pipe a file stream to a decoder stream to read a msgpack value in the file, then unpipe it and begin reading the rest of the file immediately from the octet following the msgpack value, outside the context of a msgpack stream?