Cloning a database object and using the cloned object and the original object. #2779
Unanswered
AlphabetsAlphabets
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have a question about the following scenario.
db
like thisdb
and pass it in as an argument for an async task.tokio::spawn(routine(db.clone())
This is the implementation of
routine
.I'm curoius about how the database operations are handled.
disqualify
requires write access and let's say 5 minutes are up anddb.disqualify()
runs and does its thing. Then at the same time I run another function that requires write access to the database as well. I'd like to know about the behaviour.I'd prefer it to be option 2 since this code is used by multiple people at the same time, I'd prefer it if nothing crashes and service is cut off from all users.
Aside from these two questions I did find #917 (comment) where it is said that it's meant to be used this way, but I'd simply like some confirmation as to whether it still applies based on how I create the connection.
Thanks in advanced
Beta Was this translation helpful? Give feedback.
All reactions