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

refactor!(rs): make LoroDoc !Sync #687

Closed
wants to merge 2 commits into from
Closed

Conversation

zxch3n
Copy link
Member

@zxch3n zxch3n commented Mar 14, 2025

Fix #685. It's a breaking change for the loro Rust crate.

LoroDoc should not be Sync because &LoroDoc is not safe to send to another thread. It may lead to misuse. !Sync + Send would require users to use Arc<Mutex> when they need to send LoroDoc to another thread.

@zxch3n zxch3n requested a review from Leeeon233 March 14, 2025 09:39
@zxch3n
Copy link
Member Author

zxch3n commented Mar 16, 2025

Close as it's not a perfect solution since LoroDoc is still Clone, which shares the underlying obj and can be then sent to another thread

@zxch3n zxch3n closed this Mar 16, 2025
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

Successfully merging this pull request may close these issues.

LoroDoc and threading (Rust API)
2 participants