7 Aug
2009
7 Aug
'09
6:22 a.m.
Hi, Derik. In my opinion, you must not place together async operations and their sequence in the queue. The word "async" means "somewhen" and does not means some order. So I suggest not to rely on "the handlers placed on the queue always in sequence". I try to design my async apps with such thinking. When you need some sequence, just schedule 1 op, and when its completion handler fires - schedule 2nd op... and so on. As for "2", I should say that at least in one-thread implementation, the timer will fire with error code, not success code. As for "1", I assume the same - error codes will be not success codes. The most important thing - call "cancel" inside the io_service thread (use "post" some function, as Igor already said)