Do you know an example showing a clean way to share a reference between actix-web and another thread ?
I'm able to declare a
lazy_static variable and then share the ref between a thread and actix, but I find this solution quite ugly and would like to improve it.
The usecase is to share the ref of a struct wrapping a Dashmap between a thread building the hashmap and actix-web allowing (among other things) to query it.
If I try to pass a ref using actix
app_data, I get a "App data is not configured, to configure use App::data()" and if I clone it I get another instance of my variable which is not what I want.
Any ideas ?