Take a look at http://casablanca.codeplex.com/wikipage?title=Asynchronous%20Streams, specifically "Producer Consumer".
Here's the reference doc: http://microsoft.github.io/cpprestsdk/class_concurrency_1_1streams_1_1producer__consumer__buffer.html
Here's the reference doc: http://microsoft.github.io/cpprestsdk/class_concurrency_1_1streams_1_1producer__consumer__buffer.html