appsignal/mongo-rust-driver

Trying to pass between threads

goriunov opened this issue · 2 comments

When i am trying to clone pool and pass it to another thread i am getting this error:

*mut mongoc_sys::bindings::mongoc_client_t` cannot be sent between threads safely

what would you suggest to properly pass pool to another thread ?

What are you trying to do here? Do you have code illustrating the issue?

@goriunov You should get a new client in each new thread from the ClientPool by using pop. The ClientPool is what you should be sharing between threads. http://mongoc.org/libmongoc/1.12.0/mongoc_client_pool_t.html