如何快速释放 DB 连接 #2965
Answered
by
limingxinleo
limingxinleo
asked this question in
Q&A
如何快速释放 DB 连接
#2965
-
以上场景,就会导致 |
Beta Was this translation helpful? Give feedback.
Answered by
limingxinleo
Dec 13, 2020
Replies: 1 comment
-
显而易见,我们只需要让读取用户信息的逻辑,跑在子协程中,然后配合
然后我们可以调用
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
limingxinleo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
显而易见,我们只需要让读取用户信息的逻辑,跑在子协程中,然后配合
Channel
阻塞当前协程即可。v2.1
里已经实现了这个方法,v2.0
中我们可以导入以下组件然后我们可以调用
wait()
方法,达成这个效果。