mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 18:37:41 +02:00
migrate to actix-web beta 14 (#209)
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2021-xx-xx
|
||||
* Update `actix-web` dependency to `4.0.0.beta-14`. [#209]
|
||||
|
||||
[#209]: https://github.com/actix/actix-extras/pull/209
|
||||
|
||||
|
||||
## 0.10.0-beta.3 - 2021-10-21
|
||||
|
@ -32,7 +32,7 @@ web = [
|
||||
actix = { version = "0.12.0", default-features = false }
|
||||
actix-rt = { version = "2.1", default-features = false }
|
||||
actix-service = "2.0.0"
|
||||
actix-tls = { version = "3.0.0-rc.1", default-features = false, features = ["connect"] }
|
||||
actix-tls = { version = "3.0.0-rc.2", default-features = false, features = ["connect"] }
|
||||
|
||||
log = "0.4.6"
|
||||
backoff = "0.2.1"
|
||||
@ -45,15 +45,14 @@ tokio = { version = "1", features = ["sync"] }
|
||||
tokio-util = "0.6.1"
|
||||
|
||||
# actix-session
|
||||
actix-web = { version = "4.0.0-beta.10", default_features = false, optional = true }
|
||||
actix-web = { version = "4.0.0-beta.14", default_features = false, optional = true }
|
||||
actix-session = { version = "0.5.0-beta.4", optional = true }
|
||||
rand = { version = "0.8.0", optional = true }
|
||||
serde = { version = "1.0.101", optional = true }
|
||||
serde_json = { version = "1.0.40", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
actix-test = "0.1.0-beta.5"
|
||||
actix-http = "3.0.0-beta.11"
|
||||
actix-test = "0.1.0-beta.8"
|
||||
actix-rt = "2.1"
|
||||
env_logger = "0.8"
|
||||
serde = { version = "1.0.101", features = ["derive"] }
|
||||
|
@ -3,8 +3,8 @@ use std::io;
|
||||
|
||||
use actix::prelude::*;
|
||||
use actix_rt::net::TcpStream;
|
||||
use actix_service::boxed::{service, BoxService};
|
||||
use actix_tls::connect::{ConnectError, ConnectInfo as Connect, Connection, Connector};
|
||||
use actix_service::boxed::{self, BoxService};
|
||||
use actix_tls::connect::{ConnectError, ConnectInfo, Connection, ConnectorService};
|
||||
use backoff::backoff::Backoff;
|
||||
use backoff::ExponentialBackoff;
|
||||
use log::{error, info, warn};
|
||||
@ -27,7 +27,7 @@ impl Message for Command {
|
||||
/// Redis communication actor
|
||||
pub struct RedisActor {
|
||||
addr: String,
|
||||
connector: BoxService<Connect<String>, Connection<String, TcpStream>, ConnectError>,
|
||||
connector: BoxService<ConnectInfo<String>, Connection<String, TcpStream>, ConnectError>,
|
||||
backoff: ExponentialBackoff,
|
||||
cell: Option<actix::io::FramedWrite<RespValue, WriteHalf<TcpStream>, RespCodec>>,
|
||||
queue: VecDeque<oneshot::Sender<Result<RespValue, Error>>>,
|
||||
@ -45,7 +45,7 @@ impl RedisActor {
|
||||
|
||||
Supervisor::start(|_| RedisActor {
|
||||
addr,
|
||||
connector: service(Connector::default().service()),
|
||||
connector: boxed::service(ConnectorService::default()),
|
||||
cell: None,
|
||||
backoff,
|
||||
queue: VecDeque::new(),
|
||||
@ -57,7 +57,7 @@ impl Actor for RedisActor {
|
||||
type Context = Context<Self>;
|
||||
|
||||
fn started(&mut self, ctx: &mut Context<Self>) {
|
||||
let req = Connect::new(self.addr.to_owned());
|
||||
let req = ConnectInfo::new(self.addr.to_owned());
|
||||
self.connector
|
||||
.call(req)
|
||||
.into_actor(self)
|
||||
|
Reference in New Issue
Block a user