On 11/20/2016 05:04 PM, Klemens Morgenstern wrote:
No, but who - except you - cares?
I am trying to help you with a more generic API for asynchronous operations. If you support asio::async_result, then you get all sorts of integration, including with coroutines and fibers, for free. When Nat asked about fibers, you responded that you were open to suggestions, so I would have thought that you cared too. I am, but the problem is a bit more complex than that. I see three
Am 20.11.2016 um 17:52 schrieb Bjorn Reese: possibilities for handling the exit code: future<int> handler(int, error_code) yield_context. The first two are possible with child() and the latter with system. The preferred way for me is to use child, so you have a handle. So the exception here is yield_context because using that with system seems intuitive to me. I don't see how I could use this with child, because you'd have to suspend the coroutine in on_success, which will lead to possible errors if you put something behind it in the argument-list that needs the on_success call. Therefore, it's restrictet to bp::system. That's the main reason, so it's an exception, it does not try to be a correct asio-interface.