What is the correct way to pass in a connection pool to tokio threads? #2216
Unanswered
RohanKapurDEV
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
-
I have the following code below. It's really basic and self-explanatory. My main issue is that I am not entirely sure how to pass in the MySql connection pool to the
tokio::spawn
in the loop. My conceptual understanding of the issue (which might be flawed on it's own) is that I'mmove
ing the connection pool into the thread on one iteration of the loop, which means future iterations cannot access that value to pass it in thecalculate_refreshed_obligation
function to begin with.Any help would be much appreciated
Beta Was this translation helpful? Give feedback.
All reactions