Intro When working on one of my projects I decided to create simple logging API and Rust seemed like a perfect choice to learn some new tech. Same goes for going with Azure CosmosDB which now offer free tier that is perfect for learning and small per...

Markdown supported · ⌘↵ to post
Hi Benjamin, Thank you for reading it! As for Mutex and Arc they serve different purposes and complement each other. Arc is used for reference counting and making sure you can safely pass and access object from multiple threads/tasks, and Mutex makes sure only one can change it at a time by putting a lock on it.
But you're right, we could remove the Mutex in this situation as the Arc is all we need. Great spot! :)
Benjamin Eder
Hi there! Thanks for the tutorial. Pretty sure you do not need to use Mutex for sharing the MongoDB client instance between threads.
Comment from docs of
Client: