BEGIN digression
outside of the need of having to manage the ownership of the cancellation_signal explicitely which I'd consider a bug (e.g. the following code crashes which led me to put it as global for an example - maybe same as this issue? https://github.com/chriskohlhoff/asio/issues/1332 )
I'd like to know what I'm missing in this code to make sure I never get an exception thrown out of my io_context::run, e.g. I don't want cancellation to be treated as an exceptional error (because it's not, I have an API where things can be subscribed / unsubscribed as part of a normal operation state which in turn should cancel running awaitables).
Right now it fails immediately with
terminate called after throwing an instance of 'boost::wrapexcept<boost::system::system_error>'
what(): co_await: Operation canceled [system:125]
Reposted from SO: https://stackoverflow.com/questions/78213176/boost-asio-how-to-cancel-awaitable-without-causing-termination
BEGIN digression outside of the need of having to manage the ownership of the
cancellation_signal
explicitely which I'd consider a bug (e.g. the following code crashes which led me to put it as global for an example - maybe same as this issue? https://github.com/chriskohlhoff/asio/issues/1332 )END digression
I'd like to know what I'm missing in this code to make sure I never get an exception thrown out of my io_context::run, e.g. I don't want cancellation to be treated as an exceptional error (because it's not, I have an API where things can be subscribed / unsubscribed as part of a normal operation state which in turn should cancel running awaitables).
Right now it fails immediately with
despite me calling
in the coroutine