Open oberien opened 7 years ago
Not possible, protobuf uses varints.
Couldn't someone™ create a PR to tokio-rs/tokio-io then to support protobuf's variants?
That would just be a different/new kind of abstraction. If we want it we can just do it here.
Currently inside our codecs we write / read the length prefix and have logic to ensure that we only ever decode a full frame. Instead of manually taking care of it, we could use tokio-io's
length_delimited
, which will automatically length-prefix written messages and ensure to only ever pass full frames to the decoder.