Unleash / unleash-client-rust

Unleash client SDK for Rust language projects
Apache License 2.0
23 stars 17 forks source link

Make Client::memoize return a thread safe error #21

Closed frxstrem closed 2 years ago

frxstrem commented 2 years ago

The Client::memoize function currently returns a Box<dyn std::error::Error> error, which is not thread safe. I assume that this was a mistake, as every other error type in the crate is Box<dyn std::error::Error + Send + Sync> instead.

As a consequence of this, the future returned by Client::poll_for_updates is also not thread-safe, which means that it can, for example, not be spawned in a background task with tokio::spawn.