If (0 = std::distance(sep, std::end(tasks))) If (response.status_code() >= 400) //one possible source of exceptions Status_code status = response.status_code() Tasks_t get_vector_of_tasks(concurrency::cancellation_token cancel_token) Log_debug("observe_all_exceptions: task ends with exception ") Log_debug("observe_all_exceptions: task ends with exception ", x.what()) Std::for_each(first, last, (pplx::task t) Void observe_all_exceptions(InIt first, InIt last) Otherwise, observe_all_exceptions() can take a while. The key requirement is that all tasks returned by get_vector_of_tasks() be created with cancel_token, and that they check and respond to it reasonably quickly during operation. Both that code and the real get_vector_of_tasks() are class member functions in the actual code. The code following it, though, is pretty much verbatim from the application, minus extraneous stuff that doesn't pertain to the use of observe_all_exceptions(). get_vector_of_tasks() is a stand-in for the actual much-more-complex source of the vector so don't take it too seriously. Observe_all_exceptions() is lifted directly from here. Here is a condensation of what I'm doing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |