You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exposed API use lazy bytestrings, however internally protobuf works with strict chunks. Some libraries can provide stream of strict bytestrings directly. Having an API which accepts strict bytestrings will allow to get get rid of unnecessary wrapping when feeding protobuf deserializer. Example:
protobufSink:: (Monadm, ReflectDescriptora, Wirea) =>ConduitTByteString{- strict, taken from http-conduit -}oma
protobufSink =do
maybeInput <- await
case maybeInput ofJust input -> go $ runGet messageGetM (LBS.fromStrict input) {- unnecessary wrapping -}where
go (Failed i s) =fail ("Failed at "++show i++" : "++s)
go (Finished _ _ a) =return a
go (Partial f) = f .fmapLBS.fromStrict {- unnecessary wrapping -}<$> await >>= go
Nothing->fail"No input."
The text was updated successfully, but these errors were encountered:
Exposed API use lazy bytestrings, however internally protobuf works with strict chunks. Some libraries can provide stream of strict bytestrings directly. Having an API which accepts strict bytestrings will allow to get get rid of unnecessary wrapping when feeding protobuf deserializer. Example:
The text was updated successfully, but these errors were encountered: