mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 18:37:41 +02:00
align descriptions
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
name = "actix-redis"
|
||||
version = "0.12.0"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Redis integration for Actix"
|
||||
description = "Actor-based Redis client"
|
||||
license = "MIT OR Apache-2.0"
|
||||
keywords = ["actix", "redis", "async"]
|
||||
homepage = "https://actix.rs"
|
||||
|
@ -1,6 +1,6 @@
|
||||
# actix-redis
|
||||
|
||||
> Redis integration for Actix.
|
||||
> Actor-based Redis client.
|
||||
|
||||
[](https://crates.io/crates/actix-redis)
|
||||
[](https://docs.rs/actix-redis/0.12.0)
|
||||
|
@ -4,27 +4,26 @@
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
|
||||
mod redis;
|
||||
use derive_more::{Display, Error, From};
|
||||
pub use redis::{Command, RedisActor};
|
||||
pub use redis_async::{error::Error as RespError, resp::RespValue, resp_array};
|
||||
|
||||
mod redis;
|
||||
pub use self::redis::{Command, RedisActor};
|
||||
|
||||
/// General purpose `actix-redis` error.
|
||||
#[derive(Debug, Display, Error, From)]
|
||||
pub enum Error {
|
||||
#[display(fmt = "Redis error {}", _0)]
|
||||
#[display(fmt = "Redis error: {}", _0)]
|
||||
Redis(redis_async::error::Error),
|
||||
/// Receiving message during reconnecting
|
||||
|
||||
/// Receiving message during reconnecting.
|
||||
#[display(fmt = "Redis: Not connected")]
|
||||
NotConnected,
|
||||
/// Cancel all waters when connection get dropped
|
||||
|
||||
/// Cancel all waiters when connection is dropped.
|
||||
#[display(fmt = "Redis: Disconnected")]
|
||||
Disconnected,
|
||||
}
|
||||
|
||||
#[cfg(feature = "web")]
|
||||
impl actix_web::ResponseError for Error {}
|
||||
|
||||
// re-export
|
||||
pub use redis_async::error::Error as RespError;
|
||||
pub use redis_async::resp::RespValue;
|
||||
pub use redis_async::resp_array;
|
||||
|
@ -1,22 +1,24 @@
|
||||
use std::collections::VecDeque;
|
||||
use std::io;
|
||||
use std::{collections::VecDeque, io};
|
||||
|
||||
use actix::prelude::*;
|
||||
use actix_rt::net::TcpStream;
|
||||
use actix_service::boxed::{self, BoxService};
|
||||
use actix_tls::connect::{ConnectError, ConnectInfo, Connection, ConnectorService};
|
||||
use backoff::backoff::Backoff;
|
||||
use backoff::ExponentialBackoff;
|
||||
use backoff::{backoff::Backoff, ExponentialBackoff};
|
||||
use log::{error, info, warn};
|
||||
use redis_async::error::Error as RespError;
|
||||
use redis_async::resp::{RespCodec, RespValue};
|
||||
use tokio::io::{split, WriteHalf};
|
||||
use tokio::sync::oneshot;
|
||||
use redis_async::{
|
||||
error::Error as RespError,
|
||||
resp::{RespCodec, RespValue},
|
||||
};
|
||||
use tokio::{
|
||||
io::{split, WriteHalf},
|
||||
sync::oneshot,
|
||||
};
|
||||
use tokio_util::codec::FramedRead;
|
||||
|
||||
use crate::Error;
|
||||
|
||||
/// Command for send data to Redis
|
||||
/// Command for sending data to Redis.
|
||||
#[derive(Debug)]
|
||||
pub struct Command(pub RespValue);
|
||||
|
||||
@ -24,7 +26,7 @@ impl Message for Command {
|
||||
type Result = Result<RespValue, Error>;
|
||||
}
|
||||
|
||||
/// Redis communication actor
|
||||
/// Redis communication actor.
|
||||
pub struct RedisActor {
|
||||
addr: String,
|
||||
connector: BoxService<ConnectInfo<String>, Connection<String, TcpStream>, ConnectError>,
|
||||
|
Reference in New Issue
Block a user