[−][src]Struct reool::RedisPool
A pool to one or more Redis instances.
This is the core type of this library.
Overview
Each RedisPool
consist of one or more sub pools whereas each sub pool is only
ever connected to one Redis node.
So the number of sub pools is usually the number of nodes to connect to. Furthermore the number of sub pools can be increased via the configuration.
Reool
uses a stream to enqueue checkouts. Furthermore the number of buffered checkout
requests is always limited. Having multiple sub pools will increase the number of
checkout requests that can be enqueued.
When having more that one sub pool Reool
will retry checkout attempts on different
sub pools.
Implementations
impl RedisPool
[src]
impl<T: Poolable> RedisPool<T>
[src]
pub fn no_pool() -> Self
[src]
pub fn check_out_default<'a>(
&'a self
) -> impl Future<Output = Result<PoolConnection<T>, CheckoutError>> + 'a
[src]
&'a self
) -> impl Future<Output = Result<PoolConnection<T>, CheckoutError>> + 'a
Checkout a new connection and if the request has to be enqueued use a timeout as defined by the pool as a default.
pub async fn check_out<'_, M: Into<CheckoutMode>>(
&'_ self,
mode: M
) -> Result<PoolConnection<T>, CheckoutError>
[src]
&'_ self,
mode: M
) -> Result<PoolConnection<T>, CheckoutError>
Checkout a new connection and choose whether to wait for a connection or not
as defined by the CheckoutMode
.
pub fn connected_to(&self) -> Vec<String>
[src]
pub fn state(&self) -> PoolState
[src]
pub fn ping<TO: Into<Timeout>>(&self, timeout: TO) -> BoxFuture<Vec<Ping>>
[src]
Ping all the nodes which this pool is connected to.
timeout
is the maximum time allowed for a ping.
This method only fails with ()
if the underlying connection
does not support pinging. All other errors will be contained
in the returned Ping
struct.
Trait Implementations
impl<T: Poolable> Clone for RedisPool<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<T = ConnectionFlavour> !RefUnwindSafe for RedisPool<T>
impl<T> Send for RedisPool<T>
impl<T> Sync for RedisPool<T>
impl<T> Unpin for RedisPool<T>
impl<T = ConnectionFlavour> !UnwindSafe for RedisPool<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,