1
0
mirror of https://github.com/actix/examples synced 2025-06-28 09:50:36 +02:00

v3 examples (#364)

This commit is contained in:
Rob Ede
2020-09-12 16:49:45 +01:00
committed by GitHub
parent 3f2b2708c3
commit 49e29a5751
112 changed files with 251 additions and 333 deletions

View File

@ -5,11 +5,10 @@ authors = ["dowwie <dkcdkg@gmail.com>"]
edition = "2018"
[dependencies]
actix = "0.9.0"
actix-rt = "1.0.0"
actix-web = "2.0.0"
actix-redis = "0.8.0"
futures = "0.3.1"
redis-async = "0.6.1"
serde = { version = "1.0.71", features = ["derive"] }
actix = "0.10"
actix-web = "3"
actix-redis = "0.9"
futures = "0.3"
redis-async = "0.6.3"
serde = { version = "1", features = ["derive"] }
env_logger = "0.7"

View File

@ -1,12 +1,9 @@
#[macro_use]
extern crate redis_async;
use serde::Deserialize;
use actix::prelude::*;
use actix_redis::{Command, RedisActor};
use actix_web::{middleware, web, App, Error as AWError, HttpResponse, HttpServer};
use futures::future::join_all;
use redis_async::resp::RespValue;
use redis_async::{resp::RespValue, resp_array};
use serde::Deserialize;
#[derive(Deserialize)]
pub struct CacheInfo {
@ -74,7 +71,7 @@ async fn del_stuff(redis: web::Data<Addr<RedisActor>>) -> Result<HttpResponse, A
}
}
#[actix_rt::main]
#[actix_web::main]
async fn main() -> std::io::Result<()> {
std::env::set_var("RUST_LOG", "actix_web=trace,actix_redis=trace");
env_logger::init();