I'm having a difficult time determining how to shutdown a CAF actor system when the app receives SIGINT (^C). I'm aware of the csignal, but that takes a function (not a class function and not a lambda) hence I can't get the actor_system var in scope to send a message to my actors.
@parktomatomi already mentioned this example as a reference: https://github.com/actor-framework/actor-framework/blob/5ead6f95182e1e2fee683de59579ef35f58588da/examples/curl/curl_fuse.cpp
To add a bit more context: the reason the example polls an atomic in a loop comes from the limitations the C and C++ standards impose on signal handlers. There are very few things you can safely do here. In particular, allocating memory is unsafe. Hence, we couldn't send CAF messages even if we'd had a safe way to pass the actor system to the signal handler. Setting flags via atomic operations are among the few safe things one can do, but it means you need to poll this flag in another thread to trigger some useful action.