Struct generic_db_observer::redis::RedisConnection
source · pub struct RedisConnection {
pub request_connection: Connection,
pub pubsub_connection: PubSub,
}
Expand description
Represents a connection to Redis. We use PubSub
to receive information about whether there are updates to the monitored set, but then have to get the members of the set using a SMEMBERS command.
Since keeping the PubSub
channel open locks the redis Connection, we need two separate connections, one to listen to PubSub
notifications, and one to make requests to Redis.
Fields§
§request_connection: Connection
Connection used to make requests to Redis.
pubsub_connection: PubSub
Connection used to listen to PubSub notifications.
Auto Trait Implementations§
impl Freeze for RedisConnection
impl !RefUnwindSafe for RedisConnection
impl Send for RedisConnection
impl Sync for RedisConnection
impl Unpin for RedisConnection
impl !UnwindSafe for RedisConnection
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more