pub enum SessionMode {
PerCommand,
Stateful,
}Expand description
Session mode for hybrid routing
In hybrid mode, sessions can dynamically transition between per-command and stateful modes. This allows load balancing for stateless commands while supporting stateful commands by switching to dedicated connections.
Variants§
PerCommand
Per-command routing mode - each command can use a different backend
Benefits:
- Load balancing across multiple backend servers
- Better resource utilization
- Fault tolerance (can route around failed backends)
Limitations:
- Cannot support stateful commands (MODE READER, GROUP, etc.)
- Slightly higher latency (connection pool overhead)
Stateful
Stateful mode - using a dedicated backend connection
Benefits:
- Lowest latency (no pool overhead)
- Supports stateful commands
- Simple 1:1 client-to-backend mapping
Limitations:
- No load balancing (one backend per client)
- Less efficient resource usage
Trait Implementations§
Source§impl Clone for SessionMode
impl Clone for SessionMode
Source§fn clone(&self) -> SessionMode
fn clone(&self) -> SessionMode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SessionMode
impl Debug for SessionMode
Source§impl PartialEq for SessionMode
impl PartialEq for SessionMode
impl Copy for SessionMode
impl Eq for SessionMode
impl StructuralPartialEq for SessionMode
Auto Trait Implementations§
impl Freeze for SessionMode
impl RefUnwindSafe for SessionMode
impl Send for SessionMode
impl Sync for SessionMode
impl Unpin for SessionMode
impl UnwindSafe for SessionMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.