meilisearch / meilisearch-rust

Rust wrapper for the Meilisearch API.
https://www.meilisearch.com
MIT License
362 stars 91 forks source link

Implement `std::marker::Send` for SearchResults #577

Closed jackpeters667 closed 6 months ago

jackpeters667 commented 7 months ago

Description I'm trying to update my application following the new changes where we can use custom http clients following https://github.com/meilisearch/meilisearch-rust/pull/524#issuecomment-2056865261

struct MyStruct {
    value: String
}
[dependencies]
meilisearch-sdk = "0.26.0"

[patch.crates-io]
meilisearch-sdk = { git = "https://github.com/meilisearch/meilisearch-rust", rev = "043a553" }

When I try to compile:

dyn futures_util::Future<Output = Result<SearchResults<MyStruct>, meilisearch_sdk::errors::Error>>` cannot be sent between threads safely
irevoire commented 7 months ago

Hello, yes, I know. Sorry, this is not expected and will be fixed for the next release.

Thanks for the issue! And if you have an idea of how to fix it while also keeping the awc example working I would love to hear it!

jackpeters667 commented 7 months ago

Thanks for the awesome work!

And if you have an idea of how to fix it while also keeping the awc example working I would love to hear it!

I'll take a look and see if I can come up with something

irevoire commented 6 months ago

Hey @jackpeters667 and @c1wren, it would be nice if you could try to integrate this version (the main branch) in your code again and get back to me. If everything works for you, we'll make a release right after 😁

c1wren commented 6 months ago

@irevoire Everything is working for me now. Thank you!!