docker / libchan

Like Go channels over the network
Apache License 2.0
2.47k stars 142 forks source link

MsgPack improvements #47

Closed dmcgowan closed 9 years ago

dmcgowan commented 9 years ago

The currently Go msgpack library does not allow for encoding based on interfaces. This limits the ability of the Send operation to dynamically create underlying streams for non-bytestream ReadWriteCloser (any ReadWriteCloser not created through Sender.CreateByteStream). As a workaround, libchan.ByteStreamWrapper was added to allow the encoder to recognize any ReadWriteCloser type and transparently copy to the transport's byte stream. Ideally this extra wrapping should not need to exist and the encoder could take care of it. It is the encoders responsibility as owning the send type reflection process and to avoid having to do extra type reflection before encoding.