facebook / wangle

Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.
Apache License 2.0
3.05k stars 537 forks source link

Add a tutorial #23

Open oh-its-jimjam opened 8 years ago

oh-its-jimjam commented 8 years ago

I will write an in-depth tutorial based on my upcoming blog post - Writing high-performance servers with modern C++

I would be grateful for a peer review before I publish and merge into the README.md.

Is there anything that I have missed out? Is anything incorrect? Does it flow correctly? Is it interesting enough?

billowqiu commented 8 years ago

good guy

viswanathgs commented 8 years ago

@jamperry, thanks for doing this. Great post!

You pasted the code from EchoServer.cpp into the final client example though in the post. Also, it would be good to mention a couple of lines about ClientBootstrap just like you did for ServerBootstrap.

One more comment. In your initial logical flow of the pipeline, step 3 reads "Handler 3 receives a string, prints it to stdout, and then sends it downstream to echo back to the client". In reality though handler 3 sends the string to handler 2 and then to handler 1 which perform the reverse operations before handling the bytes over to the socket. Do you think it's worth adding a couple of steps there to illustrate this?

oh-its-jimjam commented 8 years ago

Thanks for the feedback mate.

Yes, totally worth adding in as I mention handlers handling both downstream and upstream so makes sense to explain the other way.

Good spot on the dodgy paste too!