You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0507]: cannot move out of dereference of `deadpool_redis::Connection`
--> crates/app/src/handlers/auth/mod.rs:111:5
|
111 | conn.into_pubsub().subscribe("verification").await.unwrap();
| ^^^^^-------------
| | |
| | value moved due to this method call
| move occurs because value has type `deadpool_redis::redis::aio::Connection<std::pin::Pin<std::boxed::Box<dyn deadpool_redis::redis::aio::AsyncStream + std::marker::Send + std::marker::Sync>>>`, which does not implement the `Copy` trait
|
note: `deadpool_redis::redis::aio::Connection::<C>::into_pubsub` takes ownership of the receiver `self`, which moves value
--> /home/xenfo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redis-0.23.0/src/aio.rs:295:24
|
295 | pub fn into_pubsub(self) -> PubSub<C> {
| ^^^^
The text was updated successfully, but these errors were encountered:
The solution is to do this: let mut pubsub = Connection::take(conn).into_pubsub();, though is it possible to do this enough to use up the whole pool or does it replenish itself as needed?
Object::take (or Connection which is a type-alias) removes the object from the pool. Making space to create new objects. It does consume the connection from the pool but doesn't reduce the max_size of the pool.
Why can't I make this into a Pub/Sub channel?
The text was updated successfully, but these errors were encountered: