Expand description
§Reool
§About
Reool is a REdis connection pOOL based on redis-rs.
Reool is aimed at either connecting to a single primary node or connecting to a replica set using the replicas as read only nodes.
Currently Reool is a fixed size connection pool. Reool provides an interface for instrumentation.
You should also consider multiplexing instead of a pool based upon your needs.
§The ConnectionLike
trait
Both PooledConnection
and RedisPool
implement the ConnectionLike
interface of redis-rs for easy integration.
ConnectionLike::get_db
should be handled with care since the pool will always return
-1. Currently connections from the pool will also do so if the connection was teriminated
by an IO error. So ConnectionLike::get_db
so always handled with care.
§Documentation
For documentation visit crates.io.
§License
Reool is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT for details. License: Apache-2.0/MIT
Re-exports§
pub use crate::error::CheckoutError;
pub use crate::error::CheckoutErrorKind;
pub use redis;
Modules§
- config
- Configuration for
RedisPool
including a builder. - connection_
factory - Building blocks for creating a
ConnectionFactory
- error
- instrumentation
- Pluggable instrumentation
Structs§
- Cmd
- Represents redis commands.
- Immediately
- Simply a shortcut for
CheckoutMode::Immediately
- Millis
- Ping
- The result of a ping. Can either be a success or a failure.
- Pool
Connection - A connection that has been taken from the pool.
- Pool
Default - Simply a shortcut for
CheckoutMode::PoolDefault
- Pool
State - The current state of the pool
- Redis
Error - Represents a redis error. For the most part you should be using the Error trait to interact with this rather than the actual struct.
- Redis
Pool - A pool to one or more Redis instances.
- Seconds
- Timeout
- A timeout which can also be seen as a deadline
- Wait
- Simply a shortcut for
CheckoutMode::Wait
Enums§
- Checkout
Mode - Various options on retrieving a connection
- Connection
Flavour - Numeric
Behavior - Helper enum that is used in some situations to describe the behavior of arguments in a numeric context.
- Ping
State - Indicates whether a ping was a success or a failure
- Value
- Internal low-level redis value enum.
Traits§
- Async
Commands - Implements common redis commands over asynchronous connections. This allows you to send commands straight to a connection or client.
- Connection
Like - An async abstraction over connections.
- From
Redis Value - This trait is used to convert a redis value into a more appropriate
type. While a redis
Value
can represent any response that comes back from the redis server, usually you want to map this into something that works better in rust. For instance you might want to convert the return value into aString
or an integer. - Poolable
- Something that can be put into the connection pool
- Redis
Ops - A helper trait to easily execute common
asynchronous Redis operations on a
redis::aio::ConnectionLike
- ToRedis
Args - Used to convert a value into one or multiple redis argument strings. Most values will produce exactly one item but in some cases it might make sense to produce more than one.
Functions§
- cmd
- Shortcut function to creating a command with a single argument.
Type Aliases§
- Redis
Future - Library generic future type.