codecs
authorDave Watson <davejwatson@fb.com>
Wed, 21 Jan 2015 16:12:33 +0000 (08:12 -0800)
committerwoo <woo@fb.com>
Mon, 2 Feb 2015 21:12:06 +0000 (13:12 -0800)
commit7660d85b9e902101b5415f618613adca5bd17f94
tree78c9603754460d52e93fa277260b1b3485ce71ec
parentebc33419bfee687d5b4d55e6aa942a4af27c91bd
codecs

Summary:
Start of codec framework.  Copied the frame based codecs almost exactly from netty, but made to fit our pipeline management.

BytesToMessageCodec is slightly different: Netty preprocesses all the available data to a List<Message>, while this codec a) Only does one message at a time to avoid queueing issues, and b) doesn't template the message type, and just passes an IOBuf

I'm fighting the type system to get the pipelines to play nice to each other:  I'd rather template the message type, but it prevents stacking outgoing handlers on top of it, since you ahve to specify both the input/output type for each handler, even if you only care about the output type.  Suggestions to fix?   Netty gets around this by lots of dynamic casting to Object type, but we can't do that in C++ since we don't have a base object type

Test Plan: Includes lots of tests

Reviewed By: jsedgwick@fb.com

Subscribers: jsedgwick, doug, fugalh, folly-diffs@

FB internal diff: D1758189

Tasks: 50023615002316

Signature: t1:1758189:1421170225:6bc8cc6a0bb461a965665bc88f7009033b215da9
folly/wangle/codec/ByteToMessageCodec.cpp [new file with mode: 0644]
folly/wangle/codec/ByteToMessageCodec.h [new file with mode: 0644]
folly/wangle/codec/CodecTest.cpp [new file with mode: 0644]
folly/wangle/codec/FixedLengthFrameDecoder.h [new file with mode: 0644]
folly/wangle/codec/LengthFieldBasedFrameDecoder.cpp [new file with mode: 0644]
folly/wangle/codec/LengthFieldBasedFrameDecoder.h [new file with mode: 0644]
folly/wangle/codec/LengthFieldPrepender.cpp [new file with mode: 0644]
folly/wangle/codec/LengthFieldPrepender.h [new file with mode: 0644]
folly/wangle/codec/README.md [new file with mode: 0644]