Using AWC client inside tauri application #3129
-
Hello I have some question regarding AWC crate client library. Can I use AWC inside tauri? Do I need to run full actix-web server for that? Is there is a way to spawn actix-rt thread in another separate thread? Or AWC is indeed thightly coupled to actix-web? Edit: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Firstly, you don't need a server to run You can use the actix-rt macro to get a usable secondary thread. // this macro expands to a sync function
#[actix_rt::main]
async fn non_main_thread() {
let client = awc::Client::default();
}
std::thread::spawn(move || non_main_thread()); |
Beta Was this translation helpful? Give feedback.
-
Thank you for fast answer. Seem like it possible to do that. I am going to try it and come back here later. |
Beta Was this translation helpful? Give feedback.
Firstly, you don't need a server to run
awc
.You can use the actix-rt macro to get a usable secondary thread.