
On 19 Dec 2013 at 8:17, Oliver Kowalke wrote:
// fiber gets suspended until message was read boost::asio::async_read( socket_, boost::asio::buffer( channel), yield[ec]); if ( ec) throw std::runtime_error("some error");
// fiber gets suspended until message was written boost::asio::async_write( socket_, boost::asio::buffer( data_, max_length), yield[ec]);
You can find more detailed infos in boost.fiber's docu: http://ok73.funpic.de/boost/libs/fiber/doc/html/fiber/asio.html The library itself contains several examples demonstrating the usage together with boost.asio.
You just made me VERY interested in the forthcoming Fiber peer review, thank you. AFIO's third worked example in its tutorial is a peak performance "find in files" implementation and it, being completely asynchronous right down to even enumerating directories, is a mess of callbacks. I had assumed that was as good as it could get. It looks possible that Fiber could replace much of that mess of callbacks with something far more readable. You definitely have my attention now, I may even have a crack at adding Fiber support to AFIO, and see what happens. One again, thank you. Niall -- Currently unemployed and looking for work. Work Portfolio: http://careers.stackoverflow.com/nialldouglas/