
Igore Dmit. wrote:
My problem is that any synchronous-access function breaks into many little functions that do some part of job and invoke async operation with "next" function as a handler, it makes the code really ugly and obfuscating.
I know exactly what you mean. We've started using the proposed Boost.Coroutine library (not yet official, a Google Summer of Code effort plus some bug fixes). You might be interested that the original author specifically targets use with ASIO. http://www.crystalclearsoftware.com/soc/coroutine/index.html http://www.crystalclearsoftware.com/soc/coroutine/coroutine/asio.html http://www.boostpro.com/vault/index.php?action=downloadfile&filename=boost-coroutine-2009-12-01.tar.gz&directory=Concurrent%20Programming& A couple of the bundled tests are built around ASIO.