tokio-serde
tokio-serde copied to clipboard
Add reading and writing example
I ran into issues trying to get a duplex pipeline working. It took me a few hours to figure out I should have been using tokio_util::codec::Framed
. This PR attempts to add a duplex pipeline example showing:
- How to set up a duplex pipeline
- How to use none
SymmetricallyFramed
transport to serialize/deserialize to and from aRequest
andResponse
struct. - How to send and receive after each other
Started a new project using tokio-serde, couldn't figure out how to do bidirectional framed and ran into this (my own) PR....
@carllerche any chance we could merge this?