I think that this is a common use case, when you are using AsyncDB you want to pass it to each subservice by cloning, for example.
Consideration
As AsyncDB is just a wrapper around tokio::mpsc channel, there should be no problem with just deriving Clone. Expect JoinHandle, for that we can just wrap it around Arc and it will drop when last reference will be dropped
Solution
Derive Clone for AsyncDB, and add Arc around JoinHandle (see #40)
Problem
I think that this is a common use case, when you are using
AsyncDB
you want to pass it to each subservice by cloning, for example.Consideration
As
AsyncDB
is just a wrapper aroundtokio::mpsc
channel, there should be no problem with just derivingClone
. ExpectJoinHandle
, for that we can just wrap it aroundArc
and it will drop when last reference will be droppedSolution
Derive
Clone
forAsyncDB
, and addArc
aroundJoinHandle
(see #40)