-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean application shutdown #50
Comments
The right pattern is pretty much the same -- you should be able to trace how all the asynchronous tasks join together back into your main thread. If you're inside a task, this can be accomplished by returning the inner task you'd like to wait on. If you're simply in a normal c++ thread such as main(), you can call |
What does it mean in practice though? For example, what happens if we are in the middle of a network operation when we are exiting the application? Let's say we issued the request on an http_client object and the underlying network stack (and casablanca) is doing it's work, downloading a large file or waiting for a network timeout. How should we safely cancel such a task? In our app we have hundreds of these simultaneously (downloading avatars for people, tokens for decrypting contents etc). Should we keep track of all these request tasks? And if we have these tracked, how do we cancel them? Thanks. |
When you create a request on an One way to utilize this is to create a On shutdown of your application you can then invoke a |
Hi folks,
I just wanted to check with you what the best practices are for cleanly shutting down an application running Casablanca with ongoing async tasks? Normally in a multi-thread application we would join all worker threads. What's the right usage pattern for Casablanca and PPLX?
Thanks,
Chris
The text was updated successfully, but these errors were encountered: