Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql-zone ReadableZone::query_async cannot be shared between threads safely #443

Open
moqle opened this issue Nov 16, 2024 · 2 comments
Open

Comments

@moqle
Copy link

moqle commented Nov 16, 2024

Box::pin(fut)
| ^^^^^^^^^^^^^ dyn Future<Output = std::result::Result<Vec<MySqlRow>, sqlx::Error>> + std::marker::Send cannot be shared between threads safely

How can I fixed it?

@ximon18
Copy link
Member

ximon18 commented Nov 16, 2024

Hi @moqle,

Thankyou for trying out the domain crate, especially the unstable Zone feature and the MySQL example!

https://docs.rs/domain/latest/domain/zonetree/trait.ReadableZone.html#method.query_async shows that the function signature includes both Send and Sync:

fn query_async(
    &self,
    qname: Name<Bytes>,
    qtype: Rtype,
) -> Pin<Box<dyn Future<Output = Result<Answer, OutOfZone>> + Send + Sync>>

Your code fragment lacks the Sync bound. Perhaps you need to add it?

Ximon

@moqle
Copy link
Author

moqle commented Nov 23, 2024

thanks! I'll try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants